changeset 52126:b05b839160a3

8209447: vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_none2indy_b/TestDescription.java timed out Summary: was walking code cache for every safepoint because redefined methods take a long time to clear out of the code cache Reviewed-by: eosterlund, rehn
author coleenp
date Wed, 15 Aug 2018 15:50:23 -0400
parents 43e41800d579
children 0aa5378d4f09
files src/hotspot/share/classfile/classLoaderData.inline.hpp
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/classfile/classLoaderData.inline.hpp	Wed Aug 15 10:44:56 2018 -0700
+++ b/src/hotspot/share/classfile/classLoaderData.inline.hpp	Wed Aug 15 15:50:23 2018 -0400
@@ -94,9 +94,12 @@
 }
 
 bool ClassLoaderDataGraph::should_clean_metaspaces_and_reset() {
-  bool do_cleaning = _safepoint_cleanup_needed && _should_clean_deallocate_lists;
+  // Only clean metaspaces after full GC.
+  bool do_cleaning = _safepoint_cleanup_needed;
 #if INCLUDE_JVMTI
-  do_cleaning = do_cleaning || InstanceKlass::has_previous_versions();
+  do_cleaning = do_cleaning && (_should_clean_deallocate_lists || InstanceKlass::has_previous_versions());
+#else
+  do_cleaning = do_cleaning && _should_clean_deallocate_lists;
 #endif
   _safepoint_cleanup_needed = false;  // reset
   return do_cleaning;