Integrated: 8320924: Improve heap dump performance by optimizing archived object checks
Aleksey Shipilev
shade at openjdk.org
Mon Dec 4 08:23:51 UTC 2023
On Tue, 28 Nov 2023 20:24:17 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> Profiling heap dumping code reveals another simple issue: `mask_dormant_archived_object` on dumping hotpath takes quite a bit of time. We can reflow it for better inlineability, throwing out the non-essential parts into cold method. There is also no reason to peek into java mirror with (default) keep-alive, if we only use the result for null-check.
>
> Example improvements on Mac M1:
>
>
> % for I in `seq 1 5`; do build/macosx-aarch64-server-release/images/jdk/bin/java -XX:+UseParallelGC -XX:+HeapDumpAfterFullGC -Xms8g -Xmx8g HeapDump.java 2>&1 | grep created; rm *.hprof; done
>
> # Before
> Heap dump file created [1897307608 bytes in 1.584 secs]
> Heap dump file created [1897308278 bytes in 1.439 secs]
> Heap dump file created [1897308508 bytes in 1.460 secs]
> Heap dump file created [1897308505 bytes in 1.423 secs]
> Heap dump file created [1897308554 bytes in 1.414 secs]
>
> # After
> Heap dump file created [1897307648 bytes in 1.509 secs]
> Heap dump file created [1897308498 bytes in 1.281 secs]
> Heap dump file created [1897308554 bytes in 1.282 secs]
> Heap dump file created [1897308512 bytes in 1.263 secs]
> Heap dump file created [1897308554 bytes in 1.270 secs]
>
>
> ...which is about +12% faster heap dump.
>
> I also eyeballed the generated code and saw `mask_dormant_archived_object` fully inlined at least on x86_64.
This pull request has now been integrated.
Changeset: f32ab8cc
Author: Aleksey Shipilev <shade at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/f32ab8cc47c8a1b4887e9c7c86b145ce4b85c546
Stats: 41 lines in 3 files changed: 19 ins; 17 del; 5 mod
8320924: Improve heap dump performance by optimizing archived object checks
Reviewed-by: yyang, stuefe
-------------
PR: https://git.openjdk.org/jdk/pull/16863
More information about the hotspot-dev
mailing list