diff src/hotspot/share/memory/metaspaceShared.cpp @ 53564:dfa02b3f728c

8201375: Add the AllowArchivingWithJavaAgent diagnostic vm option to allow the use of the -javaagent option during CDS dumping Summary: Allow Java agent during CDS dumping if the AllowArchivingWithJavaAgent dignostic option is specified. Reviewed-by: iklam, jiangli, sspitsyn, dcubed
author ccheung
date Fri, 16 Nov 2018 16:10:25 -0800
parents 3a9384c12260
children 3009ca99de32
line wrap: on
line diff
--- a/src/hotspot/share/memory/metaspaceShared.cpp	Fri Nov 16 23:39:51 2018 +0100
+++ b/src/hotspot/share/memory/metaspaceShared.cpp	Fri Nov 16 16:10:25 2018 -0800
@@ -1494,6 +1494,12 @@
   if (PrintSystemDictionaryAtExit) {
     SystemDictionary::print();
   }
+
+  if (AllowArchivingWithJavaAgent) {
+    warning("This archive was created with AllowArchivingWithJavaAgent. It should be used "
+            "for testing purposes only and should not be used in a production environment");
+  }
+
   // There may be other pending VM operations that operate on the InstanceKlasses,
   // which will fail because InstanceKlasses::remove_unshareable_info()
   // has been called. Forget these operations and exit the VM directly.