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

coleen.phillimore at oracle.com coleen.phillimore at oracle.com
Thu May 3 13:55:23 UTC 2018

This looks good - thank you for fixing this!

On 4/30/18 10:07 AM, Thomas Stüfe 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