-
Enhancement
-
Resolution: Unresolved
-
P3
-
repo-leyden
Project Leyden is enhancing CDS to take further advantage of training runs. Decisions - such as loaded classes, profiling data, etc - are collected during the training run and used to create a CDS archive.
Currently, the training run must exit normally for the data to be reported - either as CDS's current classlist or to execute the _assembly phase_ in the Leyden repo's "premain" branch.
It may be difficult for users to run to normal completion for all training runs - some may prefer to only record data until the application framework has started or prior to some method being invoked.
This RFE is to track other possible triggers for CDS data to be collected and / or for the _assembly phase_ to being.
* JCMD: a new jcmd can be developed to attach to a running JVM and signal the training run has ended. For classic CDS, this may be the point at which the classlist is dumped to the file. For premain CDS, this may trigger the start of the assembly phase and the creation of the CDS archive.
* API: a new Leyden-specific API may be created that allows developers to indicate programatically the point at which the training run should end. This could be as simple as a static method `Leyden.endTraining()` or something that exposes more state such as the name of the CDS file. Details TBD based on need.
* Commandline: a new option could specify when to trigger the end of the training run. ie: `-XX:CDSEndTrainingOnEntry=org.foo.bar.someMethod`. This can be extended beyond single entry to also include a counted entry ie: the 1000 time this method is entered.
This would make it easier to stop training runs at the appropriate place for users who don't otherwise have an easy workload that runs to completion (ie: server applications) or who need to end training before non-framework code is executed so that training would more broadly applicable.
Currently, the training run must exit normally for the data to be reported - either as CDS's current classlist or to execute the _assembly phase_ in the Leyden repo's "premain" branch.
It may be difficult for users to run to normal completion for all training runs - some may prefer to only record data until the application framework has started or prior to some method being invoked.
This RFE is to track other possible triggers for CDS data to be collected and / or for the _assembly phase_ to being.
* JCMD: a new jcmd can be developed to attach to a running JVM and signal the training run has ended. For classic CDS, this may be the point at which the classlist is dumped to the file. For premain CDS, this may trigger the start of the assembly phase and the creation of the CDS archive.
* API: a new Leyden-specific API may be created that allows developers to indicate programatically the point at which the training run should end. This could be as simple as a static method `Leyden.endTraining()` or something that exposes more state such as the name of the CDS file. Details TBD based on need.
* Commandline: a new option could specify when to trigger the end of the training run. ie: `-XX:CDSEndTrainingOnEntry=org.foo.bar.someMethod`. This can be extended beyond single entry to also include a counted entry ie: the 1000 time this method is entered.
This would make it easier to stop training runs at the appropriate place for users who don't otherwise have an easy workload that runs to completion (ie: server applications) or who need to end training before non-framework code is executed so that training would more broadly applicable.
- relates to
-
JDK-8320264 Unified Ahead-of-Time Cache
- Draft
-
JDK-8325147 Ahead-of-Time Method Profiling
- Draft
-
JDK-8315737 JEP 483: Ahead-of-Time Class Loading & Linking
- Integrated