RFR: 8036703: Add trace event with statistics for the metaspace chunk free lists
Erik Helin
erik.helin at oracle.com
Thu Mar 6 16:16:54 UTC 2014
Hi Stefan,
thanks for reviewing! Please see comments inline and the new webrev at:
http://cr.openjdk.java.net/~ehelin/8036703/webrev.02/
On 2014-03-06 11:02, Stefan Karlsson wrote:
>
> 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/
>
> http://cr.openjdk.java.net/~ehelin/8036703/webrev.00/src/share/vm/gc_interface/collectedHeap.cpp.udiff.html
>
>
> This isn't used:
>
> + MetaspaceChunkFreeListSummary chunk_free_list_summary;
Fixed.
On 2014-03-06 11:02, Stefan Karlsson wrote:
> http://cr.openjdk.java.net/~ehelin/8036703/webrev.00/src/share/vm/memory/metaspace.cpp.udiff.html
>
>
> + void index_bounds_check(ChunkIndex index) const {
>
> Should be static. Or maybe a #define if you want to get the line where
> the assert happens.
Agree, I turned it into a macro to get the correct line numbers in an
eventual hs_err file (good if the build is lacking debug symbols).
On 2014-03-06 11:02, Stefan Karlsson wrote:
> err_msg("Bad index: " INT32_FORMAT, (int) index));
>
> Should be %d instead of INT32_FORMAT.
Fixed.
On 2014-03-06 11:02, Stefan Karlsson wrote:
> 2682 return
> MetaspaceChunkFreeListSummary(cm->num_free_chunks(SpecializedIndex),
> 2683
> cm->num_free_chunks(SmallIndex),
> 2684
> cm->num_free_chunks(MediumIndex),
> 2685
> cm->num_free_chunks(HumongousIndex),
> 2686
> cm->size_free_chunks_in_bytes(SpecializedIndex),
> 2687
> cm->size_free_chunks_in_bytes(SmallIndex),
> 2688
> cm->size_free_chunks_in_bytes(MediumIndex),
> 2689
> cm->size_free_chunks_in_bytes(HumongousIndex));
>
> I think it's better to keep the setup of MetaspaceChunkFreeListSummary
> in ChunkManager.
Agree, I've added the method ChunkManager::chunk_free_list_summary.
On 2014-03-06 11:02, Stefan Karlsson wrote:
> Otherwise, this looks good.
Thanks!
Erik
> thanks,
> StefanK
>
>>
>> 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