[gclist] why malloc/free instead of GC?

Larry Evans jcampbell3@prodigy.net
Wed, 19 Feb 2003 21:09:14 -0600

Arlie Davis wrote:
> Also, in environments that mix reference counting with unmanaged heaps,
> such as COM development on Win32, you must also account for the time
> spent in AddRef and Release.  Most thread-safe implementations use
> interlocked integer primitives, which are quite costly on SMP machines.
> I've done a fair amount of profiling of real-world server apps on Win32,
> and in many implementations, SMP scalability is severely hindered by the
> very high frequency of interlocked operations.  In services that make
> heavy use of COM interfaces, reference counting is often one of the
> biggest users of interlocked access.
If smart pointers were used, wouldn't weighted reference counting
[ Richard E. Jones and Rafael D. Lins. _Cyclic weighted reference counting without delay_
   Technical Report 28-92, Computing Laboratory, The University of Kent at Canterbury, December 1992
alleviate this at the cost of more memory being used by the smart pointers?