Request for review (medium): 6684579

Y Srinivas Ramakrishna Y.S.Ramakrishna at Sun.COM
Mon Nov 17 19:34:49 UTC 2008

6684579 SoftReference processing can be made more efficient


It turns out that, at least for current soft reference clearing
policies where the soft-ref master clock is advanced only at
each major GC, we can decide accurately (always for stop-world
collectors, and for all current clearing policies also for
concurrent collectors) whether a soft reference should not be
cleared at the point at which the reference object is first
discovered. This moves at least some of the load from the
final reference processing phase into the marking phase
(concurrent marking phase for the concurrent collectors)
making for shorter GC pauses on account of processing
SoftReference objects. For the specific, albeit somewhat extreme,
case of this customer using the CMS collector the improvement
was quite dramatic, going from 26 seconds to about 120 ms.
In most cases, the performance improvement will be more modest
depending on the size and population of soft references in
the heap.

Although the number of lines and files touched is rather large,
the changes are wide and shallow, rather than deep, and mainly
involve a change in the interface presented by some of the ReferenceProcessor
methods to allow for the use of a soft ref policy object in the
ReferenceProcessor object, rather than being a parameter to the
processing methods.

Thanks for your reviews.
-- ramki

More information about the hotspot-gc-dev mailing list