RFR: 8320924: Improve heap dump performance by optimizing archived object checks [v2]
Aleksey Shipilev
shade at openjdk.org
Thu Nov 30 10:41:09 UTC 2023
On Wed, 29 Nov 2023 17:32:19 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.
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
>
> Switch logging: debug -> trace
If there are no other comments, I would integrate this soon. Thanks!
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16863#issuecomment-1833502676
More information about the hotspot-dev
mailing list