Native Memory Tracking

  • Published on
    13-Jul-2015

  • View
    2.762

  • Download
    6

Embed Size (px)

Transcript

<ul><li><p>Native Memory Tracking</p><p>Takahiro YAMADA@yamadamn</p><p>2013/11/9</p></li><li><p> Native Memory Tracking (NMT) </p><p> NMT</p></li><li><p> Native Memory Tracking (NMT) </p><p> NMT</p></li><li><p>Native Memory Tracking (NMT) </p><p> Java 510%</p><p> Oracle (HotSpot) JDK 7 Update 40 (7u40) JRockitprint_memusageHotSpot</p><p>Oracle</p></li><li><p>NMT</p><p> -XX:NativeMemoryTracking=[off|summary|detail]</p><p> jcmdNMT jcmd VM.native_memory</p><p>[summary | detail | baseline | summary.diff | detail.diff | shutdown | autoShutdown][scale= KB | MB | GB]</p><p> jcmd help VM.native_memory</p><p> off NMT ()</p><p>summary detail summary</p></li><li><p> Native Memory Tracking (NMT) </p><p> NMT</p></li><li><p>NMT (1)$ jcmd24000 com.sun.enterprise.glassfish.bootstrap.ASMain --domain domain1 23974 org.apache.derby.drda.NetworkServerControl start24112 sun.tools.jcmd.JCmd</p><p>$ jcmd 24000 VM.native_memory summary24000:</p><p>Native Memory Tracking:</p><p>Total: reserved=946746KB, committed=695670KB</p><p>- Java Heap (reserved=786432KB, committed=583168KB) (mmap: reserved=786432KB, committed=583168KB)</p><p>- Class (reserved=4196KB, committed=4196KB) (classes #14259) (malloc=4196KB, #5743)</p><p> ()- Pooled Free Chunks (reserved=187KB, committed=187KB) (malloc=187KB)</p></li><li><p>NMT (2)$ jcmd 24000 VM.native_memory detail (summary)</p><p>Virtual memory map:</p><p>[0x000000004018a000 - 0x000000004028b000] reserved 1028KB for Thread Stack from [JavaThread::run()+0x24] [0x000000004018a000 - 0x000000004028b000] committed 1028KB from [JavaThread::run()+0x24]</p><p>[0x0000000040540000 - 0x0000000040641000] reserved 1028KB for Thread Stack from [GCTaskThread::run()+0x1c] [0x0000000040540000 - 0x0000000040641000] committed 1028KB from [GCTaskThread::run()+0x1c]</p><p> ()[0x00002aea3c810889] WatcherThread::run()+0x19 (mmap: reserved=1028KB, committed=1028KB)</p><p>[0x00002aea3c815ce6] Threads::create_vm(JavaVMInitArgs*, bool*)+0x1b6 (mmap: reserved=1028KB, committed=1028KB)</p></li><li><p>NMT (3)$ jcmd 24000 VM.native_memory baseline24000:Successfully baselined.</p><p> ()$ jcmd 24000 VM.native_memory summary.diff24000:</p><p>Native Memory Tracking:</p><p>Total: reserved=979593KB +30511KB, committed=728741KB +30735KB</p><p>- Java Heap (reserved=786432KB, committed=582144KB -1023KB) (mmap: reserved=786432KB, committed=582144KB -1023KB)</p><p>- Class (reserved=4370KB +174KB, committed=4370KB +174KB) (classes #15772 +1513) (malloc=4370KB +174KB, #6890 +1133)</p><p> ()- Pooled Free Chunks (reserved=17651KB +17464KB, committed=17651KB +17464KB) (malloc=17651KB +17464KB)</p></li><li><p> Native Memory Tracking (NMT) </p><p> NMT</p></li><li><p>JVM</p><p> NMT-XX:+UnlockDiagnosticVMOptions </p><p> NMT-XX:+PrintNMTStatistics</p><p> VMNMT</p><p> -XX:NativeMemoryTracking=[summary|detail]</p><p> -XX:-AutoShutdownNMT NMT</p><p> (: )NMT</p></li><li><p>jcmdTips jcmd 0 </p><p> PID0JVM VM.native_memory</p><p>(jcmd -h)</p><p>$ jcmd 0 VM.native_memory24000:</p><p>Native Memory Tracking:</p><p>Total: reserved=954125KB, committed=714821KB</p><p>- Java Heap (reserved=786432KB, committed=593408KB) (mmap: reserved=786432KB, committed=593408KB) </p><p>()</p><p>23974:Native memory tracking is not enabled NMT</p></li><li><p>[] JRockitprint_memusage</p><p> jrcmd print_memusage$ jrcmd23227 weblogic.Server</p><p>23402 jrockit.tools.jrcmd.JrCmd</p><p>$ jrcmd 23227 print_memusage23227:Total mapped 2098408KB (reserved=1143216KB)- Java heap 524288KB (reserved=0KB)- GC tables 17548KB- Thread stacks 33572KB (#threads=37)- Compiled code 1048576KB (used=12253KB)- Internal 1352KB- OS 222184KB- Other 129800KB- Classblocks 6656KB (malloced=6615KB #18395)- Java class data 113408KB (malloced=113207KB #83208 in 18395 classes)- Native memory tracking 1024KB (malloced=88KB #10)</p></li><li><p> NMT Native Memory Tracking in 7u40 | Marcus Hirt</p><p> http://hirt.se/blog/?p=401 - print_memusage (JRockit)</p><p> http://docs.oracle.com/cd/E22646_01/doc.40/b61441/diagnostic.htm#BABJHFHC</p><p> jcmd jcmd </p><p> http://www.slideshare.net/TsunenagaHanyuda/jcmd-16803399 JDK7u4 - Programming Studio</p><p> http://www.coppermine.jp/docs/programming/2012/08/jdk7u4.html</p><p> Java Roadmap JavaOne 2013 Report - Java Roadmap</p><p> http://www.slideshare.net/OracleMiddleJP/javaone-2013-report/21</p></li><li><p> JDK7u40Native Memory Tracking (NMT) </p><p> JDK6</p><p>1.4 2002/2 2006/125.0 2004/5 2009/106 2006/12 2013/27 2011/7 2015/3 (*)</p><p>* http://www.oracle.com/technetwork/jp/java/eol-135779-ja.html</p></li><li><p>Takahiro YAMADA@yamadamn</p><p>2013/11/9</p></li></ul>