[9] RFR (XS): 8151623: Zap freed Metaspace chunks in non-product binaries

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Fri Mar 11 07:55:25 UTC 2016


>>   http://cr.openjdk.java.net/~vlivanov/8151623/webrev.02/
>
> Yes, like that.
>
> The change in the Metachunk constructor changes semantics in that
> the original code mangled the whole chunk, not just the payload. I'd
> prefer that the original code is left.  The little bit of code
> duplication is
> OK.
I think they are equivalent:

     _top = initial_top();
     size_t data_word_size = pointer_delta(end(), _top, sizeof(MetaWord));
     Copy::fill_to_words((HeapWord*)_top,
                         data_word_size,
                         metadata_chunk_initialize);
vs

     HeapWord* start = (HeapWord*)initial_top();
     size_t size = word_size() - overhead();
     Copy::fill_to_words(start, size, word_value);


_top == initial_top() and data_word_size == size:

   end() == this + _word_size
   pointer_delta ==  (end() - _top) / sizeof(MetaWord)

> http://cr.openjdk.java.net/~vlivanov/8151623/webrev.02/src/share/vm/memory/metachunk.hpp.frames.html
>
> Please use the style "word_value" instead of "wordValue".
Will fix.

> 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.
Ok, I'll verify that.

Best regards,
Vladimir Ivanov


More information about the hotspot-dev mailing list