8199518: test/hotspot/jtreg/runtime/SelectionResolution tests take a lot longer to run with fastdebug after JDK-8198423
authorstuefe
Tue, 13 Mar 2018 20:06:34 +0100
changeset 49386 d89e98d85841
parent 49385 1517b9220e64
child 49387 98e7a2c315a9
8199518: test/hotspot/jtreg/runtime/SelectionResolution tests take a lot longer to run with fastdebug after JDK-8198423 Summary: added metaspace verfications in fastdebug were too aggressive for this test and made fastdebug too slow Reviewed-by: zgu, coleenp
src/hotspot/share/memory/metaspace.cpp
--- a/src/hotspot/share/memory/metaspace.cpp	Tue Mar 13 18:27:20 2018 +0100
+++ b/src/hotspot/share/memory/metaspace.cpp	Tue Mar 13 20:06:34 2018 +0100
@@ -1694,8 +1694,11 @@
 
   inc_container_count();
 
-  DEBUG_ONLY(chunk_manager->locked_verify());
-  DEBUG_ONLY(this->verify());
+  if (metaspace_slow_verify) {
+    DEBUG_ONLY(chunk_manager->locked_verify());
+    DEBUG_ONLY(this->verify());
+  }
+
   DEBUG_ONLY(do_verify_chunk(result));
 
   result->inc_use_count();
@@ -1946,8 +1949,10 @@
   // should not affect that count.
 
   // At the end of a chunk merge, run verification tests.
-  DEBUG_ONLY(this->locked_verify());
-  DEBUG_ONLY(vsn->verify());
+  if (metaspace_slow_verify) {
+    DEBUG_ONLY(this->locked_verify());
+    DEBUG_ONLY(vsn->verify());
+  }
 
   return true;
 }
@@ -2966,11 +2971,13 @@
 
   // Run some verifications (some more if we did a chunk split)
 #ifdef ASSERT
-  locked_verify();
-  VirtualSpaceNode* const vsn = chunk->container();
-  vsn->verify();
-  if (we_did_split_a_chunk) {
-    vsn->verify_free_chunks_are_ideally_merged();
+  if (metaspace_slow_verify) {
+    locked_verify();
+    VirtualSpaceNode* const vsn = chunk->container();
+    vsn->verify();
+    if (we_did_split_a_chunk) {
+      vsn->verify_free_chunks_are_ideally_merged();
+    }
   }
 #endif