[concurrency-interest] WeakReference overhead

Boehm, Hans hans.boehm at hp.com
Wed Jan 2 13:28:42 EST 2008

> -----Original Message-----
> From:  Joseph Seigh
> On a hunch, I replaced the WeakReference PDR hack in my
> experimental STM implementation with reference counting.  It
> knocked down the GC times by about 2/3's.
> So it would seem that
> the Java Reference implementation has lots of GC overhead and
> should not be used on short lived objects.  Overall the
> reduction in STM runtime was about 1/3.
I would expect Java WeakReference and finalization to be implementated similarly, and to both be rather slow.  Most implementations assume (usually correctly) that a small fraction of objects is affected and instead optimize for the normal case (few weak references, trivial finalizers).  There are some simple measuremetns for finalization on slide 6 of http://www.hpl.hp.com/personal/Hans_Boehm/misc_slides/java_finalizers.pdf , which is now several years old.


More information about the Concurrency-interest mailing list