Home > Articles > Programming > Windows Programming

  • Print
  • + Share This

Memory Support

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.

  • + Share This
  • 🔖 Save To Your Account

Related Resources

There are currently no related titles. Please check back later.