JDK-8043052 : Supply a flag to print out shared archive information
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2014-05-13
  • Updated: 2014-12-04
  • Resolved: 2014-08-30
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 9
9Resolved
Related Reports
Duplicate :  
Relates :  
Description
We need an option to print out shared archive information. Say, -XX:+PrintSharedArchiveAndExit to just print out the contents in the archive. 

It should do the following internally:

   1)  Enable -Xshare:on and -XX:+TraceClassPaths
   2) Attempt to load and validate the archive
   3) When a mismatch is encountered (e.g., a JAR file's modification date has been changed), print out the error information but continue
        a) However, since -cp is not specified (it's default to be ""), it will always mismatch. So do not print this out to avoid confusion
        b) If user specifies -cp. print "-cp should not be specified when using -XX:+PrintSharedArchiveAndExit" and exit
        c) Similarly, bootclasspath and java_ext_dir may mismatch. Do not print these are errors (maybe just as warnings).
    4) Also, as an extra, print out the entire content of the shared dictionary, so that we know what classes are stored in this archive
    5) Also, print out the size statics of the symbol table
    6)  Do not attempt to map the archive. Exit the JVM.

Comments
This feature (-XX:+PrintSharedArchiveAndExit) is included as part of JDK-8046070 - "Class Data Sharing clean up and refactoring"
30-08-2014

Did you consider enhancing PrintSharedSpaces? Why exit without mapping the archive?
19-05-2014