JDK-8227370 : Remove SharedPathsMiscInfo
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 14
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-07-07
  • Updated: 2021-11-15
  • Resolved: 2019-08-28
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 14
14 b12Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8230291 :  
Description
JDK-8211723 removed the separate CDS runtime path check using SharedPathsMiscInfo and enhanced the shared path table validation to cover the additional checks. The the only usage now left for SharedPathsMiscInfo is to make sure the dump-time non-existing path components do not exist at runtime. However, SharedPathsMiscInfo::add_path() is still called to record all boot and app class paths and their types (separate from the shared path table). That adds unnecessary footprint overhead to the archive file. Also, runtime reads in all the recorded SharedPathsMiscInfo paths-string and types from the archive header. In most common use cases, all components end up just being skipped. That adds unnecessary runtime startup time overhead. The runtime processing of _paths_misc_info_size before the header validation can cause crashes in cases when the archive is invalid, JDK-8226406.

Additionally, the SharedPathsMiscInfo does not cover module path properly.

The RFE is created to further clean-up and remove SharedPathsMiscInfo completely. The non-existing path components can be recorded in the shared path table's SharedClassPathEntry::_type at dump time. The runtime non-existing path check should be done as part of the shared path table validation. That will allow us to remove SharedPathsMiscInfo and eliminate the memory and startup overhead caused by SharedPathsMiscInfo usage.

Currently, the CDS path recording and checking related code spreads in filemap.*, classLoader.*, classLoaderExt.*, and sharedPathsMiscInfo.*. With the removal of SharedPathsMiscInfo, it will allow us to further clean up the CDS code.
Comments
Git URL: https://github.com/openjdk/jdk/commit/87eefe2e0021804ef929f1e8d984248f161c9708
15-11-2021

URL: https://hg.openjdk.java.net/jdk/jdk/rev/5ddb746d45e0 User: iklam Date: 2019-08-28 05:30:09 +0000
28-08-2019

There's no need to record the non-existent files during dump time. We can simply eliminate all the non-existent paths from both the dumptime and runtime paths, and check that the remaining files match. E.g., dump: -cp a.jar:NE1:NE2:b.jar run 1: -cp NE3:a.jar:NE4:b.jar run 2: -cp x.jar:NE4:b.jar after elimination: dump = a.jar:b.jar run 1 = a.jar:b.jar -> matched run 2 = x.jar:b.jar -> mismatched Preliminary webrev: http://cr.openjdk.java.net/~iklam/jdk14/8227370_remove_shared_misc_info.v01/
22-08-2019

Currently, there's no plan to address this in JDK 14. That's why the "Fix version" was set to "tbd".
19-07-2019

Calvin, I'm assigning this to you to eliminate the cost for maintaining SharedPathsMiscInfo. I think this needs to be addressed in JDK 14. Thanks.
19-07-2019