RFR: 8036703: Add trace event with statistics for the metaspace chunk free lists

Erik Helin erik.helin at oracle.com
Thu Mar 13 13:06:27 UTC 2014


Hi Coleen,

thanks for having a look!

On 2014-03-12 22:10, Coleen Phillimore wrote:
> Wow, that looks good.

Thanks for your kind words :)

On 2014-03-12 22:10, Coleen Phillimore wrote:
> The only comment I had was that this macro for
> index index_bounds_check in metaspace.cpp could be an inlined static
> function, then you could avoid the odd while loop.

I use a macro because I want to get the correct line in the assertion 
failure in an eventual hs_err file. Using a static inline function would 
only give me the line numbers of the static inline function.

Since we don't always get a stack trace in the hs_err file, this would 
make it hard to determine if the assertion failure comes from 
size_free_chunks_in_bytes or num_free_chunks.

You can see the updated macro in the incremental webrev (see metaspace.cpp):
http://cr.openjdk.java.net/~ehelin/8036703/webrev.03-04/

What do you think?

Thanks,
Erik

> Coleen
>
> On 3/12/14 12:04 PM, Erik Helin wrote:
>> Based on feedback from Mikael and StefanK, I've reworked the patch to
>> put the ChunkFreeListSummaries in the class MetaspaceSummary.
>>
>> Please see the new version at:
>> http://cr.openjdk.java.net/~ehelin/8036703/webrev.03/
>>
>> Thanks,
>> Erik
>>
>> On 2014-03-06 11:56, Erik Helin wrote:
>>> A small bug had found its way into this patch:
>>>
>>> metaspace.cpp:
>>> +bool MetaspaceAux::has_chunk_free_list(Metaspace::MetadataType
>>> mdtype) {
>>> +  return Metaspace::get_chunk_manager(mdtype) == NULL;
>>> +}
>>>
>>> should of course be:
>>>
>>> +bool MetaspaceAux::has_chunk_free_list(Metaspace::MetadataType
>>> mdtype) {
>>> +  return Metaspace::get_chunk_manager(mdtype) != NULL;
>>> +}
>>>
>>> Please see new webrev at:
>>> http://cr.openjdk.java.net/~ehelin/8036703/webrev.01/
>>>
>>> Thanks,
>>> Erik
>>>
>>> On 2014-03-06 10:35, Erik Helin wrote:
>>>> Hi all,
>>>>
>>>> this patch adds a new trace event -
>>>> vm/gc/metaspace/chunk_free_list_summary for getting statistics for
>>>> metaspace's chunk free lists. The event contains the numbers of chunks
>>>> in the free list and the size of the chunks in the free lists. This
>>>> information is provided for all different kinds of chunks - special,
>>>> small, medium and humongous.
>>>>
>>>> This information will be useful when diagnosing fragmentation issues in
>>>> metaspace.
>>>>
>>>> Webrev:
>>>> http://cr.openjdk.java.net/~ehelin/8036703/webrev.00/
>>>>
>>>> Enhancement:
>>>> https://bugs.openjdk.java.net/browse/JDK-8036703
>>>>
>>>> Testing:
>>>> - JFR JTREG tests
>>>> - JPRT
>>>> - Manually verifying that the numbers look correct by looking at
>>>>    recordings from small test cases.
>>>>
>>>> Thanks,
>>>> Erik
>


More information about the hotspot-dev mailing list