RFR: 8251330: Reorder CDS archived heap to speed up relocation [v5]
Matias Saavedra Silva
matsaave at openjdk.org
Mon Mar 11 19:43:23 UTC 2024
> We should reorder the archived heap to segregate the objects that don't need marking. This will save space in the archive and improve start-up time
>
> This patch reorders the archived heap to segregate the objects that don't need marking. The leading zeros present in the bitmaps thanks to the reordering can be easily removed, and this the size of the archive is reduced.
>
> Given that the bitmaps are word aligned, some leading zeroes will remain. Verified with tier 1-5 tests.
>
> Metrics, courtesy of @iklam :
> ```calculate_oopmap: objects = 15262 (507904 bytes, 332752 bytes don't need marking), embedded oops = 8408, nulls = 54
> Oopmap = 15872 bytes
>
> calculate_oopmap: objects = 4590 (335872 bytes, 178120 bytes don't need marking), embedded oops = 46487, nulls = 29019
> Oopmap = 10496 bytes
>
> (332752 + 178120) / (507904 + 335872.0) = 0.6054592688106796
> More than 60% of the space used by the archived heap doesn't need to be marked by the oopmap.
>
> $ java -Xshare:dump -Xlog:cds+map | grep lead
> [3.777s][info][cds,map] - heap_oopmap_leading_zeros: 143286
> [3.777s][info][cds,map] - heap_ptrmap_leading_zeros: 50713
>
> So we can reduce the "bm" region by (143286 + 50713) / 8 = 24249 bytes.
>
> Current output:
> $ java -XX:+UseNewCode -Xshare:dump -Xlog:cds+map | grep lead
> [5.339s][info][cds,map] - heap_oopmap_leading_zeros: 26
> [5.339s][info][cds,map] - heap_ptrmap_leading_zeros: 8
Matias Saavedra Silva has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 37 commits:
- Merge branch 'master' into reorder_archive_heap_8251330
- Merge branch 'master' into reorder_archive_heap_8251330
- Moved slice method to new PR
- Updated slice and truncate to be bit aligned
- Removed unused methods and reordered code
- Merge branch 'master' into reorder_archive_heap_8251330
- Slice method now copies and Ioi Comments
- Renamed variables and moved pointer patching shift
- Added helper function
- Merge branch 'master' into reorder_archive_heap_8251330
- ... and 27 more: https://git.openjdk.org/jdk/compare/c65d3089...a09cd64a
-------------
Changes: https://git.openjdk.org/jdk/pull/17350/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17350&range=04
Stats: 225 lines in 9 files changed: 194 ins; 8 del; 23 mod
Patch: https://git.openjdk.org/jdk/pull/17350.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/17350/head:pull/17350
PR: https://git.openjdk.org/jdk/pull/17350
More information about the hotspot-dev
mailing list