[8u] RFR: Avoid initializing unused SharedHeap::_workers for Shenandoah

Aleksey Shipilev shade at redhat.com
Fri Oct 11 16:50:10 UTC 2019


This is 8u-specific fix. The underlying reason for it was resolved since 9 with JDK-8076454.

Roman noticed during 8u debugging that we have two sets of GC workers. One comes from
SharedHeap::_workers, and another comes from ShenandoahHeap::_workers. We do that to implement our
own ShenandoahWorkGang. Unfortunately, that means SharedHeap::_workers gets initialized, takes
memory and is not used. Moreover, the codepaths that take SharedHeap::workers() would use the wrong
set of workers! Oops.

The way out is to stop initializing SharedHeap::_workers in shared code, and do that during
Shenandoah initialization:
   https://cr.openjdk.java.net/~shade/shenandoah/8u-double-workers/webrev.01/

The improvement is clearly visible with NMT:

NMT (before):

  Thread (reserved=49387KB, committed=49387KB)
         (thread #49)
         (stack: reserved=49176KB, committed=49176KB)
         (malloc=155KB #268)
         (arena=56KB #84)

NMT (after):

  Thread (reserved=36021KB, committed=36021KB)
         (thread #36)
         (stack: reserved=35864KB, committed=35864KB)
         (malloc=116KB #190)
         (arena=41KB #58)

Testing: hotspot_gc_shenandoah {fastdebug, release}, eyeballing NMT logs

-- 
Thanks,
-Aleksey



More information about the shenandoah-dev mailing list