JDK-8283474 : Include detailed heap object info in CDS map file
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-03-21
  • Updated: 2022-04-02
  • Resolved: 2022-04-02
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 19
19 masterFixed
Related Reports
Relates :  
Relates :  
Description
Currently the cds.map file produced by "java -Xshare:dump -Xlog:cds+map=trace:file=cds.map:none:filesize=0" prints information of each individual metaspace object. 

This is useful in diagnosing problems with deterministic CDS archive files (such as JDK-8253495)

For example:

[ro region          0x00000008004ca000 - 0x0000000800c452e8   7844584 bytes]
0x00000008004ca000:   
0x00000008004ca000: @@ Symbol            8 [Z
0x00000008004ca000:   5a5b0002e99effff 
0x00000008004ca008: @@ Symbol            8 [C
0x00000008004ca008:   435b000299a9ffff 
...
0x0000000800bcd838: @@ TypeArrayU1       16
0x0000000800bcd838:   3e00010000000006 0000000000000000 
0x0000000800bcd848: @@ ConstMethod       104 java.lang.String java.lang.Object.toString()
0x0000000800bcd848:   0000000000000018 0000000800651da8 0000000000000000 000c00050000000d
0x0000000800bcd868:   0006001200250024 0006000100010002 ec0000b7590100bb 03b60002b60001b6
0x0000000800bcd888:   b6ec0003b600e600 0003b60005b80004 05c000ffb00006b6 003b002400000000
0x0000000800bcd8a8:   000100000000003c 

However, there's no such printout for the archived heap objects.

This RFE adds the following info into the cds.map file.

[closed heap region 0x00000007bf800000 - 0x00000007bf87e000    516096 bytes]
0x00000007bf800000: @@ Object [B
0x00000007bf800000:   00000003f021ab01 0000000000002090 
0x00000007bf800010: @@ Object java.lang.String
0x00000007bf800010:   0000000d37cfa501 00000000000091d8 f7f0000000010100 

Comments
Changeset: c1e67b66 Author: Ioi Lam <iklam@openjdk.org> Date: 2022-04-02 03:23:49 +0000 URL: https://git.openjdk.java.net/jdk/commit/c1e67b6603b2bd6ac6b0ce43994ab13c207a6431
02-04-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7895 Date: 2022-03-21 22:10:26 +0000
21-03-2022

An example of "java -Xshare:dump -Xlog:cds+map=trace:file=cds.map:none:filesize=0" with the added heap object information can be found in the attachment cds.map.trace.gz
21-03-2022