110 likes | 239 Views
Новости в Java SE 6. Monitoring and Management. Mihail Stoynov mihail.stoynov.com. Demo. Java Process Status Tool jps. C:> JConsole. JConsole. Dynamic Attach You can connect to every process started in Java SE 6 HotSpot VM (through Attach API)
E N D
Новости в Java SE 6 Monitoring and Management Mihail Stoynovmihail.stoynov.com
Demo Java Process Status Tool jps
JConsole • Dynamic Attach • You can connect to every process started in Java SE 6 HotSpot VM (through Attach API) • No more -Dcom.sun.management.jmxremoteon every application (Management Agent) • Remote monitoring • Can be password protected • Secure remote monitoring (SSL)
JConsole • Can follow memory • Can see stack trace, thread state • Can see VM summary • Can detect deadlocks • Can see all the MBeans from JMX • Can be used to detect & warn for low memory • Can tell CPU usage • Can save all
Demo A simple application seen through JConsole, jstack
Demo Remote monitoring using JConsole
HeapHistogram • Finding memomy leaks • C:\>jmap -histo 3328 • See how much instances every class has • See how much memory instances occupy • Can filter only live objects in the heap • Can save to a binary file format • JConsole can do that through an JMX Mbean • Can read with jhat
Demo Saving using JConsole
Heap Histogram on OutOfMemoryError jinfo –flag +HeapDumpOnOutMemoryError <pid> ... java.lang.OutOfMemoryError: Java heap spaceDump heap to java_pid1412.hprof ...Heap dump file created [68354173 bytes in 4.416 secs ]Exception in thread "main" java.lang.OutOfMemoryError: Java heap space ... C:\>jhat java_pid1412.hprof
Thank you Monitoring and Management Mihail Stoynovmihail.stoynov.com