JDK-8253909 : Implement detailed map file for CDS
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-10-01
  • Updated: 2022-03-21
  • Resolved: 2020-10-08
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 16
16 b20Fixed
Related Reports
Blocks :  
Relates :  
Description
For analyzing the contents of a CDS archive, we need a "map file" that describes the archive in different levels of detail. This can be done using unified logging:

(info = high level layout -- regions, etc)
java -Xshare:dump -Xlog:cds+map=info:file=cds.map:none:filesize=0

(debug = information about all metaspace objects)
java -Xshare:dump -Xlog:cds+map=debug:file=cds.map:none:filesize=0

(trace = values of every byte in the archive)
java -Xshare:dump -Xlog:cds+map=trace:file=cds.map:none:filesize=0

For example, we can use the map file for troubleshooting JDK-8253495
(runtime/cds/DeterministicDump.java broken). We can diff two different cds.map files to see where the non-deterministic contents come from.

See attachments for example contents of the map file.
Comments
Changeset: d1e94eeb Author: Ioi Lam <iklam@openjdk.org> Date: 2020-10-08 06:55:42 +0000 URL: https://git.openjdk.java.net/jdk/commit/d1e94eeb
08-10-2020

The cds.map file for the base archive is huge at the "trace" level, so I attached examples for the dynamic archive instead. E.g., java -Xlog:cds -cp ~/tmp/HelloWorld.jar -XX:ArchiveClassesAtExit=/tmp/foo.jsa -Xlog:cds+map=trace:file=cds.map.trace.txt:none:filesize=0 HelloWorld
01-10-2020