# HG changeset patch # User stuefe # Date 1525096521 -7200 # Node ID bafa1860c107b9846340d6ac1c4c812f74679f1f # Parent fc778e86381f42909e157ffd829c7e28f14c5915 8202424: Metaspace: on chunk retirement, use correct lower limit on chunksize when adding blocks to free blocks list Reviewed-by: zgu, coleenp diff -r fc778e86381f -r bafa1860c107 src/hotspot/share/memory/metaspace.cpp --- a/src/hotspot/share/memory/metaspace.cpp Thu May 03 06:20:37 2018 -0700 +++ b/src/hotspot/share/memory/metaspace.cpp Mon Apr 30 15:55:21 2018 +0200 @@ -365,6 +365,7 @@ class SmallBlocks : public CHeapObj { const static uint _small_block_max_size = sizeof(TreeChunk >)/HeapWordSize; + // Note: this corresponds to the imposed miminum allocation size, see SpaceManager::get_allocation_word_size() const static uint _small_block_min_size = sizeof(Metablock)/HeapWordSize; private: @@ -3601,7 +3602,7 @@ void SpaceManager::retire_current_chunk() { if (current_chunk() != NULL) { size_t remaining_words = current_chunk()->free_word_size(); - if (remaining_words >= BlockFreelist::min_dictionary_size()) { + if (remaining_words >= SmallBlocks::small_block_min_size()) { MetaWord* ptr = current_chunk()->allocate(remaining_words); deallocate(ptr, remaining_words); inc_used_metrics(remaining_words);