RFR(S) 8186770: NMT: Report metadata information in NMT summary

Zhengyu Gu zgu at redhat.com
Mon Aug 28 21:19:30 UTC 2017


This enhancement allows NMT to report class metadata information.

NMT has no visibility into metaspace so far, it has become an obstacle 
to estimate real memory cost for classes. While estimating the cost, we 
usually assume that class metadata occupies whole committed space, which 
results higher than actual number.

The patch uses existing metaspace APIs, and reports counters in NMT 
*Class* summary section.


Bug: https://bugs.openjdk.java.net/browse/JDK-8186770
Webrev: http://cr.openjdk.java.net/~zgu/8186770/webrev.00/index.html

Test:
   hotspot_tier1_runtime (fastdebug and release)


Sample outputs:

Class summary:

-                     Class (reserved=1071790KB, committed=24750KB)
                             (classes #3078)
                             (malloc=686KB #7122)
                             (mmap: reserved=1071104KB, committed=24064KB)
                             (  Metadata:                               )
                             (    reserved=22528KB, committed=21504KB)
                             (    capacity=21327KB, used=20654KB)
                             (    free chunks=113KB)
                             (    available=0KB)
                             (  Class space:                            )
                             (    reserved=1048576KB, committed=2560KB)
                             (    capacity=2525KB, used=2268KB)
                             (    free chunks=0KB)
                             (    available=35KB)

Class summary diff:

-                     Class (reserved=1074075KB +2290KB, 
committed=27291KB +2546KB)
                             (classes #3198 +122)
                             (malloc=923KB +242KB #8418 +1463)
                             (mmap: reserved=1073152KB +2048KB, 
committed=26368KB +2304KB)
                             (  Metadata:                               )
                             (    reserved=24576KB +2048KB, 
committed=23296KB +1792KB)
                             (    capacity=23071KB +1808KB, used=22368KB 
+1794KB)
                             (    free chunks=49KB -64KB)
                             (    available=0KB)
                             (  Class space:                            )
                             (    reserved=1048576KB, committed=3072KB 
+512KB)
                             (    capacity=2843KB +318KB, used=2400KB 
+133KB)
                             (    free chunks=141KB +141KB)
                             (    available=88KB +53KB)

Thanks,

-Zhengyu


More information about the hotspot-runtime-dev mailing list