G1 young dominated by code root marking
Thomas Schatzl
thomas.schatzl at oracle.com
Mon Oct 14 03:12:32 PDT 2013
Hi,
On Tue, 2013-10-08 at 20:42 +0200, Simone Bordet wrote:
> Hi,
>
> On Tue, Oct 8, 2013 at 8:55 AM, Thomas Schatzl
> <thomas.schatzl at oracle.com> wrote:
> > We are aware of code cache scanning taking up a significant time of the
> > collection pause - that's why starting with b106 the code cache scanning
> > has been moved into an extra phase and parallelized.
> > Previously the issue should have been worse (i.e. serialized) - or does
> > this problem only surfaced with the new build?
> > (Previously you would get a very long "Ext root scan" phase)
>
> I did not test jdk 8 prior b109, unfortunately.
Okay, thanks anyway.
>
> > I am afraid that at the moment afaik there is nothing but to reduce code
> > cache size (or increase the number of available processors to benefit
> > from parallelization).
> >
> > To help us analyze possible alternative remedies (i.e. class unloading
> > after a concurrent marking cycle), does this problem persist even after
> > stale code has been cleaned out, e.g. full gc?
> > (I think full gc cleans out old code)
>
> A preliminary test done by triggering a full GC after detecting a long
> "code root marking" like you suggested showed a small reduction in
> those times, but they remain dominant and exceed the G1 max GC pause.
> Perhaps at steady state the code cache does not change much so the
> amount of work related to it remain the same despite full GCs.
>
> I am guessing code root marking cannot be made concurrent ?
> Or split, like old generation regions evacuation is split during mixed GCs ?
>
In G1, with class-unloading at concurrent mark in place and enabled this
phase will disappear in initial-mark young GCs iirc (except for code on
the stack; other code roots will be weak roots in this case), however
there will be a new cleanup phase during remark :) It may be shorter
though.
Other than that I think it should be possible to make (parts of) the
phase concurrent, but I am not sure if it is on our radar yet.
Thomas
More information about the hotspot-gc-use
mailing list