JDK-8194812 : Extend class-data sharing to support the module path
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-01-09
  • Updated: 2019-06-20
  • Resolved: 2018-04-10
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 11
11 b10Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8198565 :  
JDK-8199638 :  
Description
Currently, the --module-path option is being ignored during CDS dumping.

./bin/java -Xshare:dump --module-path mlib -Xlog:cds=info
narrow_klass_base = 0x0000000800000000, narrow_klass_shift = 3
Allocated temporary class space: 1073741824 bytes at 0x00000008c0000000
Allocated shared space: 3221225472 bytes at 0x0000000800000000
[0.048s][info][cds] Info: the --module-path option is ignored when dumping the shared archive

This enhancement is for supporting the --module-path for CDS and AppCDS.

High-level requirements:
---------------------------------
At dump time:
- the --module-path info, such as the location field of each ModuleEntry will be captured in the shared archive header. It could be right after the boot class path and app class path info;
- initially, we will only support modular jar specified in the --module-path.

At run time:
- if a class is loaded from a modular jar from a module path, check need to ensure the path to the jar file is the same as during dump time. The timestamp and size of the jar should not change compared with dump time.
Comments
webrev: http://cr.openjdk.java.net/~ccheung/8194812/webrev.04/ design write-up: http://cr.openjdk.java.net/~ccheung/8194812/write-up/module-path-design.pdf
11-04-2018