RFR: 8320924: Improve heap dump performance by optimizing archived object checks [v2]

Aleksey Shipilev shade at openjdk.org
Wed Nov 29 17:32:19 UTC 2023


> 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

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/16863/files
  - new: https://git.openjdk.org/jdk/pull/16863/files/c2f2b3e8..e6745195

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

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

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


More information about the hotspot-dev mailing list