RFR: 8340171: CDS: Enhance bitmap truncation [v2]

Aleksey Shipilev shade at openjdk.org
Mon Sep 16 08:52:35 UTC 2024


> Current CDS archive ships multiple bitmaps. Archival/loading code makes a useful optimization: it truncates the bitmaps at the beginning when it is known the prefix contains many zeroes. The object sorting code additionally sorts the pointer-rich objects at the end of the archive, increasing the zero-prefix length.
> 
> This optimization works less efficiently after [JDK-8338912](https://bugs.openjdk.org/browse/JDK-8338912), which moved the (pointer-rich) roots array at the beginning of the archive. We need to enhance current bitmap handling mechanism to truncate bitmaps better.
> 
> This PR does two things: a) enables bitmap truncation for both leading and trailing zeros; b) sorts the oop-rich objects at the beginning, where the oop-rich roots array is.
> 
> CDS archive sizes:
> 
> 
> # Before JDK-8338912
> $ ls -la build/linux-x86_64-server-release/images/jdk/lib/server/*.jsa
> 15450112 build/linux-x86_64-server-release/images/jdk/lib/server/classes.jsa
> 15851520 build/linux-x86_64-server-release/images/jdk/lib/server/classes_nocoops.jsa
> 
> # After JDK-8338912: +8..12K regression in size
> $ ls -la build/linux-x86_64-server-release/images/jdk/lib/server/*.jsa
> 15462400 build/linux-x86_64-server-release/images/jdk/lib/server/classes.jsa
> 15859712 build/linux-x86_64-server-release/images/jdk/lib/server/classes_nocoops.jsa
> 
> # After this fix: recovered to pre-JDK-8338912 levels
> $ ls -la build/linux-x86_64-server-release/images/jdk/lib/server/*.jsa
> 15450112 build/linux-x86_64-server-release/images/jdk/lib/server/classes.jsa
> 15851520 build/linux-x86_64-server-release/images/jdk/lib/server/classes_nocoops.jsa
> 
> 
> Additional testing:
>  - [x] Linux x86_64 server fastdebug, `runtime/cds`, `tier1`, `tier2`

Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:

  Remove excessive debugging logging

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/21010/files
  - new: https://git.openjdk.org/jdk/pull/21010/files/b5d5240a..8a45759f

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

  Stats: 9 lines in 1 file changed: 0 ins; 9 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/21010.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21010/head:pull/21010

PR: https://git.openjdk.org/jdk/pull/21010


More information about the hotspot-runtime-dev mailing list