RFR: 8141341: CDS should be disabled if JvmtiExport::should_post_class_file_load_hook() is true

Jiangli Zhou jiangli.zhou at Oracle.COM
Fri Jul 8 01:08:26 UTC 2016


Please review the following webrev that disables CDS when JvmtiExport::should_post_class_file_load_hook() is enabled at runtime.

  webrev: http://cr.openjdk.java.net/~jiangli/8141341/webrev.00/
  bug: JDK-8141341 <https://bugs.openjdk.java.net/browse/JDK-8141341>

With -Xshare:on
If -Xshare:on is used and JvmtiExport::should_post_class_file_load_hook() is required, the VM now reports "Tool agent requires sharing to be disabled” and terminates. This is the same behavior as jdk8.

With -Xshare:auto
The change in meatspace.cpp is to detect the case where JvmtiExport::should_post_class_file_load_hook() is enabled very early during JVM initialization. In that case, we disable CDS entirely, including all shared classes, symbols, and Strings objects.

The change in systemDictionary.cpp is to detect the cases where JvmtiExport::should_post_class_file_load_hook() is enabled late, which include agent dynamically attached at runtime. In those cases, JVM does not allow loading classes from the shared archive. The shared symbols and Strings can still be used.

Thanks,
Jiangli




More information about the hotspot-runtime-dev mailing list