JDK-8316969 : Improve CDS module graph support for --module option
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-09-26
  • Updated: 2024-03-17
  • Resolved: 2023-11-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 22
22 b23Fixed
Description
This subtask handles the --module option only.

If the --module option is specified during dump time, the specified module, together with the base system modules, should be dumped to the CDS archive.
For now, we only support archiving jdk's modules, modules with names starting with "java." or "jdk.".

During runtime:
- if the same module is specified, the module should be loaded from the archive.
- if a different module is specified, the archived module graph should be disabled.
- if no module is specified, it should be fine to use the archived module graph.
- if an implicit module is specified which is different from the one specified during dump time. The archived module graph should be disabled.
  An implicit module is the case when the user uses a tool such as jcmd which would set the jdk.module.main property to jdk.cmd.

If no module is specified during dump time.

During runtime,
- if a module is specified, the archived module graph should be disable.
  The specified module may not be the required module which is not in the default boot layer (such as the jdk.cmd for the jcmd). So the simplest way is to disable the
  archived module graph so that required module will be loaded from the jdk image.
- if no module is specified, use the default archived module graph (same as before this RFE).
Comments
Seems the added test runtime/cds/appcds/jigsaw/module/ModuleOption.java does not work well with jdk22u, see https://bugs.openjdk.org/browse/JDK-8322092 starting 15th December 2023 we see errors in the test runtime/cds/appcds/jigsaw/module/ModuleOption.java : java.lang.RuntimeException: 'java.[0-9][0-9][-].*' missing from stdout/stderr Is that related to version number changes ? There can be different version numbers than the test expects (I think there must be a JEP / JEPs describing what is possible).
17-01-2024

Changeset: e318cd25 Author: Calvin Cheung <ccheung@openjdk.org> Date: 2023-11-02 16:03:14 +0000 URL: https://git.openjdk.org/jdk/commit/e318cd25cbb9619c5add0d00b2f192c3a7b3e4c4
02-11-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16016 Date: 2023-10-02 22:17:34 +0000
17-10-2023