JDK-8313450 : Release Note: Two Phase Segmented Heap Dump
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: 22
  • Priority: P4
  • Status: Resolved
  • Resolution: Delivered
  • Submitted: 2023-08-01
  • Updated: 2024-03-05
  • Resolved: 2024-01-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 22
22Resolved
Description
During a heap dump, the application must pause execution and wait for the VM to complete the heap dump before resuming. This enhancement aims to minimize application pause time as much as possible by dividing the heap dump into two phases:

- Phase one: Concurrent threads directly write data to segmented heap files (application is paused).
- Phase two: Multiple heap files are merged into a complete heap dump file (application is resumed).

This approach significantly reduces application pause time, but it is important to note that the total time required for the heap dump itself remains unchanged. This optimization solely focuses on minimizing the impact on the application's pause time.

When executing `jmap` or `jcmd GC.heap_dump`, the VM automatically selects an appropriate number of parallel threads based on the type of garbage collector, number of processors, heap size, and degree of fragmentation. It will attempt to perform a parallel heap dump whenever possible, falling back to using a single thread when a parallel heap dump is not possible. In this case, the heap dump behavior is the same as before, and the details of the heap dump can be observed using the `-Xlog:heapdump` option.