RFR: 8298647: GenShen require heap size 2MB granularity [v2]

Stuart Monteith smonteith at openjdk.org
Wed Jan 18 10:40:29 UTC 2023


> Generational Shenandoah requires 2MB granularity in order for card tables to cover the allocated heap. Each byte in a page of card table represents 512 heap bytes. As card tables are allocated 4KB at a time, 4KB * 512 = 2MB.
> 
> There is a circular dependency between the region calculations and the heap size calculations. This unconditionally rounds up the heap size to 2MB. It might be preferable to do this only when generational mode is enabled.
> 
> Running with:
>   java -Xlog:gc*=trace -XX:+UseShenandoahGC -mx495m \
>        -XX:ShenandoahGCMode=generational -version
> 
> on a debug build is sufficient to reproduce this problem.

Stuart Monteith has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:

 - Merge branch 'openjdk:master' into JDK-8298647
 - 8298647: GenShen require heap size 2MB granularity
   
   Generational Shenandoah requires 2MB granularity in order for card
   tables to cover the allocated heap. Each byte in a page of card table
   represents 512 heap bytes. As card tables are allocated 4KB at a time,
   4KB * 512 = 2MB.
   
   There is a circular dependency between the region calculations and the
   heap size calculations. This unconditionally rounds up the heap size to
   2MB. It might be preferable to do this only when generational mode is
   enabled.
   
   Running with:
     java -Xlog:gc*=trace -XX:+UseShenandoahGC -mx495m \
          -XX:ShenandoahGCMode=generational -version
   
   on a debug build is sufficient to reproduce this problem.

-------------

Changes:
  - all: https://git.openjdk.org/shenandoah/pull/202/files
  - new: https://git.openjdk.org/shenandoah/pull/202/files/571fe68a..96d4347d

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=shenandoah&pr=202&range=01
 - incr: https://webrevs.openjdk.org/?repo=shenandoah&pr=202&range=00-01

  Stats: 7407 lines in 420 files changed: 4387 ins; 1648 del; 1372 mod
  Patch: https://git.openjdk.org/shenandoah/pull/202.diff
  Fetch: git fetch https://git.openjdk.org/shenandoah pull/202/head:pull/202

PR: https://git.openjdk.org/shenandoah/pull/202


More information about the shenandoah-dev mailing list