The bootclasspath can be modified using a JVMTI agent via the AddToBootstrapClassLoaderSearch function.
The classpath can be modified using a JVMTI agent via the AddToSystemClassLoaderSearch function.
The above modifications can be done in the JVMTI_PHASE_ONLOAD or the JVMTI_PHASE_LIVE phase.
During the JVMTI_PHASE_ONLOAD, the AppCDS shared path hasn't been setup. So modifying the bootclasspath or classpath during the ONLOAD phase shouldn't affect AppCDS dumping. However, the shared path has been setup during the LIVE phase and it would be rather complicated to setup the shared path again.
The proposed change is to abort CDS dumping with an error message if the AddToBootstrapClassLoaderSearch or the AddToSystemClassLoaderSearch is called during dumping.
The classpath can be modified using a JVMTI agent via the AddToSystemClassLoaderSearch function.
The above modifications can be done in the JVMTI_PHASE_ONLOAD or the JVMTI_PHASE_LIVE phase.
During the JVMTI_PHASE_ONLOAD, the AppCDS shared path hasn't been setup. So modifying the bootclasspath or classpath during the ONLOAD phase shouldn't affect AppCDS dumping. However, the shared path has been setup during the LIVE phase and it would be rather complicated to setup the shared path again.
The proposed change is to abort CDS dumping with an error message if the AddToBootstrapClassLoaderSearch or the AddToSystemClassLoaderSearch is called during dumping.
- csr for
-
JDK-8213813 Add the AllowArchivingWithJavaAgent diagnostic vm option to allow the use of the -javaagent option during CDS dumping
-
- Closed
-