# HG changeset patch # User stuefe # Date 1570456106 -7200 # Node ID e3aa9f95b85eb4e53f55b4861f3c13502aec8c9c # Parent 04d2c850ab4f4b891888c774433ff7b7ea20168d Fix issue with statistics which caused Metaspace::used_words() to be too high diff -r 04d2c850ab4f -r e3aa9f95b85e src/hotspot/share/memory/metaspace/spaceManager.cpp --- 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; } }