Native Memory Tracking

  • View
    2.762

  • Download
    6

Embed Size (px)

Transcript

  • Native Memory Tracking

    Takahiro YAMADA@yamadamn

    2013/11/9

  • Native Memory Tracking (NMT)

    NMT

  • Native Memory Tracking (NMT)

    NMT

  • Native Memory Tracking (NMT)

    Java 510%

    Oracle (HotSpot) JDK 7 Update 40 (7u40) JRockitprint_memusageHotSpot

    Oracle

  • NMT

    -XX:NativeMemoryTracking=[off|summary|detail]

    jcmdNMT jcmd VM.native_memory

    [summary | detail | baseline | summary.diff | detail.diff | shutdown | autoShutdown][scale= KB | MB | GB]

    jcmd help VM.native_memory

    off NMT ()

    summary detail summary

  • Native Memory Tracking (NMT)

    NMT

  • NMT (1)$ jcmd24000 com.sun.enterprise.glassfish.bootstrap.ASMain --domain domain1 23974 org.apache.derby.drda.NetworkServerControl start24112 sun.tools.jcmd.JCmd

    $ jcmd 24000 VM.native_memory summary24000:

    Native Memory Tracking:

    Total: reserved=946746KB, committed=695670KB

    - Java Heap (reserved=786432KB, committed=583168KB) (mmap: reserved=786432KB, committed=583168KB)

    - Class (reserved=4196KB, committed=4196KB) (classes #14259) (malloc=4196KB, #5743)

    ()- Pooled Free Chunks (reserved=187KB, committed=187KB) (malloc=187KB)

  • NMT (2)$ jcmd 24000 VM.native_memory detail (summary)

    Virtual memory map:

    [0x000000004018a000 - 0x000000004028b000] reserved 1028KB for Thread Stack from [JavaThread::run()+0x24] [0x000000004018a000 - 0x000000004028b000] committed 1028KB from [JavaThread::run()+0x24]

    [0x0000000040540000 - 0x0000000040641000] reserved 1028KB for Thread Stack from [GCTaskThread::run()+0x1c] [0x0000000040540000 - 0x0000000040641000] committed 1028KB from [GCTaskThread::run()+0x1c]

    ()[0x00002aea3c810889] WatcherThread::run()+0x19 (mmap: reserved=1028KB, committed=1028KB)

    [0x00002aea3c815ce6] Threads::create_vm(JavaVMInitArgs*, bool*)+0x1b6 (mmap: reserved=1028KB, committed=1028KB)

  • NMT (3)$ jcmd 24000 VM.native_memory baseline24000:Successfully baselined.

    ()$ jcmd 24000 VM.native_memory summary.diff24000:

    Native Memory Tracking:

    Total: reserved=979593KB +30511KB, committed=728741KB +30735KB

    - Java Heap (reserved=786432KB, committed=582144KB -1023KB) (mmap: reserved=786432KB, committed=582144KB -1023KB)

    - Class (reserved=4370KB +174KB, committed=4370KB +174KB) (classes #15772 +1513) (malloc=4370KB +174KB, #6890 +1133)

    ()- Pooled Free Chunks (reserved=17651KB +17464KB, committed=17651KB +17464KB) (malloc=17651KB +17464KB)

  • Native Memory Tracking (NMT)

    NMT

  • JVM

    NMT-XX:+UnlockDiagnosticVMOptions

    NMT-XX:+PrintNMTStatistics

    VMNMT

    -XX:NativeMemoryTracking=[summary|detail]

    -XX:-AutoShutdownNMT NMT

    (: )NMT

  • jcmdTips jcmd 0

    PID0JVM VM.native_memory

    (jcmd -h)

    $ jcmd 0 VM.native_memory24000:

    Native Memory Tracking:

    Total: reserved=954125KB, committed=714821KB

    - Java Heap (reserved=786432KB, committed=593408KB) (mmap: reserved=786432KB, committed=593408KB)

    ()

    23974:Native memory tracking is not enabled NMT

  • [] JRockitprint_memusage

    jrcmd print_memusage$ jrcmd23227 weblogic.Server

    23402 jrockit.tools.jrcmd.JrCmd

    $ 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)

  • NMT Native Memory Tracking in 7u40 | Marcus Hirt

    http://hirt.se/blog/?p=401 - print_memusage (JRockit)

    http://docs.oracle.com/cd/E22646_01/doc.40/b61441/diagnostic.htm#BABJHFHC

    jcmd jcmd

    http://www.slideshare.net/TsunenagaHanyuda/jcmd-16803399 JDK7u4 - Programming Studio

    http://www.coppermine.jp/docs/programming/2012/08/jdk7u4.html

    Java Roadmap JavaOne 2013 Report - Java Roadmap

    http://www.slideshare.net/OracleMiddleJP/javaone-2013-report/21

  • JDK7u40Native Memory Tracking (NMT)

    JDK6

    1.4 2002/2 2006/125.0 2004/5 2009/106 2006/12 2013/27 2011/7 2015/3 (*)

    * http://www.oracle.com/technetwork/jp/java/eol-135779-ja.html

  • Takahiro YAMADA@yamadamn

    2013/11/9