RFR(S): 7143511: G1: Another instance of high GC Worker Other time (50ms)
john.cuthbertson at oracle.com
Mon Mar 19 10:54:17 PDT 2012
Can I have a couple of volunteers review the changes for this CR? The
webrev can be found at: http://cr.openjdk.java.net/~johnc/7143511/webrev.0/.
I am cc'ing the compiler-dev list as I changed the nmethod class to make
the routine nmethod::test_oops_do_mark() available in non-debug builds.
While running SPECjbb2012, it was noticed that the GC Worker Other time
(printed as part of the PrintGCDetails output) was quite high on certain
platforms. An investigation discovered that this time was coming from
the StrongRootsScope destructor (which is executed by the VM thread and
was being incorrectly attributed as part of the parallel time). Most of
the time for the StrongRootsScope destructor was coming from walking the
marked nmethods list, where the nmethods discovered by the
CodeBlobToOops closure in SharedHeap::process_strong_roots() are walked
to fix up any oops that may have moved during the GC. Further
investigation revealed that the nmethods were being added to the marked
list unconditionally. With TieredCompilation, the number of nmethods in
the code cache (and the number of oops in each nmethod) significanly
increased (~6000 vs. ~700 nmethods and ~115K vs ~15K oops) increasing
the time it took to walk the marked nmethod list. It was also observed
that most of the nmethods on the marked list did not contain any
pointers into the collection set and so the oops that they were pointing
to did not move during the GC. The solution was to limit the number of
nmethods placed on to the marked list by specializing the
CodeBlobToOopClosure to filter out those nmethods that did not point
into the collection set.
The other changes include refactoring the code in G1ParTask:work() and
where the G1ParTask is executed in evacuate_collection_set() so that the
values printed for the GC Worker Other time and (the new) Code Root
Fixup time are accurately calculated.
Testing: SPECjbb2012 on several platforms; the GC test suite with heap
verification after GC enabled.
More information about the hotspot-compiler-dev