Memory support
Scot Hillier

Windows 2000 Developers have to have a good understanding of the Component Object Model (COM). In our last tip, The Lowdown on Threads," we discussed how COM facilitates the use of program threads. This tip, excerpted from InformIT,

Requires Free Membership to View

discusses the way that COM+ provides memory support for developers.

Along with threads, COM+ also provides support for managing the memory used for creating components. In the most efficient case, COM+ provides for pooling instances of objects created that might be reused by subsequent client calls. This mechanism of object pooling is designed to eliminate the overhead involved in object creation.

Object pooling works by taking objects that are released by calling clients and storing them in a common pool. The objects in this pool can then be retrieved for subsequent client calls without creating a new object instance. Unfortunately, object pooling requires that components show no thread affinity. For this reason, object pooling requires that components support the TNA model. Because Visual Basic 6.0 components can't be created using the TNA model, they can't support object pooling.

On the bright side, however, Visual Basic object creation routines are generally highly optimized. For this reason, lack of object pooling features won't significantly affect your application's overall performance. Having said this, you can bet Microsoft will be trumpeting object pooling as soon as it's possible under Visual Basic 7.0.

In the absence of object pooling, COM+ helps manage memory through the use of just-in-time activation and as-soon-as-possible deactivation. This feature ensures that an object lives for only the minimum amount of time necessary to process a function call. Effectively managing the available memory is critical to scaling a distributed application.

To read more of the article from which this tip has been excerpted, click over to InformIT. You have to register to read articles on the site, but registration is free.

This was first published in November 2000

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.