src/hotspot/share/memory/metaspace/rootChunkArea.cpp
branchstuefe-new-metaspace-branch
changeset 58683 2d5dd194c65c
parent 58227 0e7d9a23261e
--- a/src/hotspot/share/memory/metaspace/rootChunkArea.cpp	Wed Oct 16 17:41:03 2019 +0200
+++ b/src/hotspot/share/memory/metaspace/rootChunkArea.cpp	Thu Oct 17 16:39:45 2019 +0200
@@ -30,6 +30,7 @@
 #include "memory/metaspace/chunkManager.hpp"
 #include "memory/metaspace/internStat.hpp"
 #include "memory/metaspace/metachunk.hpp"
+#include "memory/metaspace/metaDebug.hpp"
 #include "memory/metaspace/metaspaceCommon.hpp"
 #include "memory/metaspace/rootChunkArea.hpp"
 #include "runtime/mutexLocker.hpp"
@@ -81,8 +82,6 @@
 // Returns NULL if chunk cannot be split at least once.
 Metachunk* RootChunkArea::split(chklvl_t target_level, Metachunk* c, MetachunkListCluster* freelists) {
 
-  DEBUG_ONLY(c->verify(true);)
-
   // Splitting a chunk once works like this:
   //
   // For a given chunk we want to split:
@@ -119,8 +118,6 @@
   DEBUG_ONLY(chklvl::check_valid_level(target_level));
   assert(target_level > c->level(), "Wrong target level");
 
-  DEBUG_ONLY(verify(true);)
-
   const chklvl_t starting_level = c->level();
 
   Metachunk* result = c;
@@ -423,8 +420,8 @@
 
 void RootChunkArea::verify(bool slow) const {
 
+
   assert_lock_strong(MetaspaceExpand_lock);
-
   assert_is_aligned(_base, chklvl::MAX_CHUNK_BYTE_SIZE);
 
   // Iterate thru all chunks in this area. They must be ordered correctly,
@@ -468,7 +465,7 @@
 
 void RootChunkArea::verify_area_is_ideally_merged() const {
 
-  assert_lock_strong(MetaspaceExpand_lock);
+  SOMETIMES(assert_lock_strong(MetaspaceExpand_lock);)
 
   int num_chunk = 0;
   for (const Metachunk* c = _first_chunk; c != NULL; c = c->next_in_vs()) {