changeset 49391:d89e98d85841

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
author stuefe
date Tue, 13 Mar 2018 20:06:34 +0100
parents 1517b9220e64
children 98e7a2c315a9
files src/hotspot/share/memory/metaspace.cpp
diffstat 1 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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