RFR: Mark-compact performance improvements and cleanups

Aleksey Shipilev shade at redhat.com
Tue May 29 19:20:23 UTC 2018


http://cr.openjdk.java.net/~shade/shenandoah/mark-compact-improvs/webrev.01/

This is the pack of mark-compact cleanups and improvements.

*) mc-logging: More verbose profiling for phase 4 in mark-compact

Adds a few more profiling points in "Copy object" phase of mark compact, which enables better
performance diagnostics.

*) mc-liveness: Full GC always comes with liveness data

We used to skip liveness counting for mark-compact, because the core algorithm does not require it.
It provided some boosts when our liveness calculation was a major performance hog. It is not
anymore, and having liveness data enables us to do shortcuts, like below. This also cleans up shared
code substantially.

*) mc-immediate-trash: Reclaim immediate garbage after mark-compact marking

Once we know liveness, we can reclaim immediate garbage regions right after marking. This lets
threads down below treat the regions as the targets for compaction immediately, instead of
compacting through them. This is especially important for figuring out compaction for humongous
regions, which is planned before the regular object moves.

*) mc-shortcut-live: Shortcut regions that are known not to be alive

Same here, liveness provides us with insight if we even want to walk marked objects in the region,
or not. For the fully-garbage region it would be futile, and it will yield no marked objects.

Motivational performance data:

 - Serial: 8191M->4M Full GC cycles

    before:
      Pause Full GC (N) = 0.90 s (a =    64425 us) (n =    14)
             (lvls, us =    56250,    56836,    57617,    58594,   103983)

    after:
      Pause Full GC (N) = 0.22 s (a =    14914 us) (n =    15)
             (lvls, us =    12891,    13281,    14453,    15820,    16818)

 - retain.tree: 10239M->1070M Full GC cycles

    before:
      Pause Full GC (N) = 3.50 s (a =   291548 us) (n =    12)
             (lvls, us =   275391,   281250,   287109,   296875,   314651)

    after:
      Pause Full GC (N) = 3.54 s (a =   294925 us) (n =    12)
             (lvls, us =   285156,   287109,   292969,   296875,   304701)

 - LRUFragger: 102138M->65687M Full GC cycles

    before:
      Pause Full GC (N) = 151.24 s (a =  4726195 us) (n =    32)
             (lvls, us =  4570312,  4648438,  4707031,  4765625,  4889809)

    after:
      Pause Full GC (N) = 153.10 s (a =  4784420 us) (n =    32)
             (lvls, us =  4667969,  4746094,  4765625,  4804688,  4929369)

Testing: hotspot_gc_shenandoah {fastdebug|release}, benchmarks

Thanks,
-Aleksey



More information about the shenandoah-dev mailing list