Integrated: 8340171: CDS: Enhance bitmap truncation
Aleksey Shipilev
shade at openjdk.org
Mon Sep 23 07:05:42 UTC 2024
On Mon, 16 Sep 2024 08:41:56 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> 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`
> - [x] Linux x86_64 server fastdebug, `all`
This pull request has now been integrated.
Changeset: f31f97dd
Author: Aleksey Shipilev <shade at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/f31f97ddb6f1fca1a74761e3e3eeef497f8a7416
Stats: 35 lines in 3 files changed: 7 ins; 8 del; 20 mod
8340171: CDS: Enhance bitmap truncation
Reviewed-by: matsaave, iklam
-------------
PR: https://git.openjdk.org/jdk/pull/21010
More information about the hotspot-runtime-dev
mailing list