RFR: Adaptive heuristics should poll all phases and update at the end of cycle
Aleksey Shipilev
shade at redhat.com
Fri May 5 12:00:41 UTC 2017
Hi,
Overnight runs discovered the problem in adaptive heuristics. It adjusts the
free threshold on recording the successful CM/UR, but that means it *misses* the
counters from the rest of the cycle, only to capture them (if we are lucky) on
the next cycle.
The answer seems to be asking the heuristics to adjust at the end of the cycle,
plus do the peak polling at the end of each phase and before cleanup. Doing
after each phase is important because e.g. evac phase can do more allocations
without further cleanup. We also have to care about both CM and UR to be happy
before reducing the free threshold.
Patch:
http://cr.openjdk.java.net/~shade/shenandoah/adaptive-fullcycle/webrev.01/
Coupled with printout improvements, this provides the clear view of the GC cycle:
[gc,ergo] GC(13) Reducing free threshold to: 20% (2048M)
...
[gc,ergo] Concurrent marking triggered. Free: 2039M, Target Free: 2048M,
Allocated: 2039M, Threshold: 0M
[gc ] GC(14) Pause Init Mark 1.319ms
[gc ] GC(14) Concurrent marking 8204M->8908M(10240M) 873.952ms
[gc,ergo] GC(14) Total Garbage: 6478M
[gc,ergo] GC(14) Immediate Garbage: 36M, 9 regions
[gc,ergo] GC(14) Garbage to be collected: 5715M (88% of total), 1540 regions
[gc,ergo] GC(14) Live objects to be evacuated: 443M
[gc,ergo] GC(14) Live/garbage ratio in collected regions: 7%
[gc ] GC(14) Pause Final Mark 8908M->8880M(10240M) 10.791ms
[gc ] GC(14) Concurrent evacuation 8880M->9511M(10240M) 149.953ms
[gc ] GC(14) Pause Init Update Refs 9511M->9511M(10240M) 0.069ms
[gc ] GC(14) Concurrent update references 9511M->9892M(10240M) 429.898ms
[gc ] GC(14) Pause Final Update Refs 9892M->3733M(10240M) 1.124ms
[gc ] GC(14) Concurrent reset bitmaps 7.109ms
[gc,ergo] GC(14) Capacity: 10240M, Peak Occupancy: 9892M, Lowest Free: 347M,
Threshold Free: 307M
[gc,ergo] GC(14) Reducing free threshold to: 19% (1945M)
See e.g.: heuristics triggered CM at free threshold of 2048M. Peak occupancy was
at the start of final UR -- 9892M -- and that what heuristics recorded and acted
upon. We know it the target free is 307M (3%) and we have more, so threshold is
reduced.
Testing: SPECjbb2015
Thanks,
-Aleksey
More information about the shenandoah-dev
mailing list