RFR(xxs): 8202424: Metaspace: on chunk retirement, use correct lower limit on chunksize when adding blocks to free blocks list.

Zhengyu Gu zgu at redhat.com
Thu May 3 13:24:10 UTC 2018

Looks good to me.


On 05/03/2018 09:02 AM, Thomas Stüfe wrote:
> Hi all,
> jdk-submit tests all went thru on this one.
> I still need reviewers.
> Thanks, Thomas
> On Mon, Apr 30, 2018 at 4:07 PM, Thomas Stüfe <thomas.stuefe at gmail.com> wrote:
>> Hi all,
>> please review this small fix, which fixes a small metaspace leak when
>> retiring chunks.
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8202424
>> Webrev: http://cr.openjdk.java.net/~stuefe/webrevs/8202424-Metaspace-on-chunk-retirement-use-correct-lower-limit-on-chunksize-when-adding-blocks-to-free-blocks-list/webrev.00/webrev/
>> Some time ago, JDK-8164921 got rid of dark matter by lowering the
>> smallest block size which can be managed by the free block list to
>> sizeof(MetaBlock).
>> When retiring chunks, the leftover space in the old chunk is added to
>> the free block list via SpaceManager::deallocate(). Here, we still
>> unnecessarily assume a lower size limit of TreeChunk<Metablock,
>> FreeList<Metablock> >::min_size(), which is unnecessary high and
>> causes leaks which show up as waste in the retired chunks.
>> By correctly using SmallBlocks::small_block_min_size() when
>> deallocating the leftover chunk space on chunk retirement, we can
>> reduce that kind of waste to almost nil.
>> Thanks, Thomas

More information about the hotspot-runtime-dev mailing list