src/hotspot/share/memory/metaspace/spaceManager.cpp
branchstuefe-new-metaspace-branch
changeset 58475 e3aa9f95b85e
parent 58382 2e16658b7776
child 58683 2d5dd194c65c
--- a/src/hotspot/share/memory/metaspace/spaceManager.cpp	Fri Sep 27 19:03:34 2019 +0200
+++ b/src/hotspot/share/memory/metaspace/spaceManager.cpp	Mon Oct 07 15:48:26 2019 +0200
@@ -253,6 +253,10 @@
     if (p != NULL) {
       DEBUG_ONLY(InternalStats::inc_num_allocs_from_deallocated_blocks();)
       log_trace(metaspace)("SpaceManager %s: .. taken from freelist.", _name);
+      // Note: space in the freeblock dictionary counts as used (see retire_current_chunk()) -
+      // that means that we must not increase the used counter again when allocating from the dictionary.
+      // Therefore we return here.
+      return p;
     }
 
   }