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

Stefan Karlsson stefan.karlsson at oracle.com
Thu Mar 6 10:02:25 UTC 2014


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;


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.

err_msg("Bad index: " INT32_FORMAT, (int) index));

Should be %d instead of INT32_FORMAT.

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.

Otherwise, this looks good.

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