--- 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;
}
}