RFR (XS): 8151623: Zap freed Metaspace chunks in non-product binaries
stefan.karlsson at oracle.com
Mon Mar 21 15:10:17 UTC 2016
On 21/03/16 16:03, Vladimir Ivanov wrote:
> Stefan, Jon, thanks for the reviews!
> Last question: what do you think about moving the constant declaration
> to globalDefinitions.hpp?
Sounds good to me.
> Best regards,
> Vladimir Ivanov
> On 3/15/16 11:51 AM, Stefan Karlsson wrote:
>> Hi Vladimir,
>> On 14/03/16 19:48, Vladimir Ivanov wrote:
>>> Updated version:
>> There's a type mismatch here:
>> 149 static const size_t metadata_chunk_initialize = 0xf7f7f7f7;
>> 151 void mangle(juint word_value = metadata_chunk_initialize);
>> Otherwise, this looks good.
>>>> If there is a mistake in the mangling of a Metablock, that would
>>>> show up when the Metaspace shrinks. Can you check that the testing
>>>> has some Metaspace shrinking. I think that -Xlog:gc*=trace would
>>>> show the needed output.
>>> Thanks for the hint! It found one problem with -Xlog:gc*=trace itself:
>>> BlockFreelist keeps the tree of free blocks inside Metachunks and
>>> dumps the content from the destructor.
>>> Mangling breaks it because it happens earlier and destroys the free
>>> list structure by the time BlockFreelist destructor is called.
>>> I fixed it by dumping the free list content before Metachunks are
>>> I ran a stress test on class loading and ensured there's no memory
>>> leak in Metaspace.
>>> Best regards,
>>> Vladimir Ivanov
>>> PS: maybe add a -Xlog:gc,metaspace,freelist=trace event for metachunk
More information about the hotspot-dev