Basic JVM Troubleshooting

with JMX
Haim Yadid
VisualVM
CPU Bound Code
• Number crunching code usually due to wrong data
structure and algorithms

• High CPU consumption 

• No GC activity 

• MBean : java.lang.Threading::getThreadCpuTime
ThreadContentionMonitoringEnabled
Lock Contention
• High latency on high load 

• Cannot max out CPU with increasing load on system

• Thread stacks have locked threads 

• java.lang.Threading :: getThreadInfo
Excessive Memory Allocation
• High CPU consumption 

• High rate of memory allocation

• MBean : java.lang.Threading::GetThreadAllocatedBytes
Heap Exhaustion
• High CPU consumption 

• Frequent GC triggering 

• Heap usage after GC is higher than old generation

• MBean: java.lang.GarbageCollector

• CollectionTime
Java Thread Top
• Open source project 

• https://github.com/lifey/Java-threadTop

• connects to a process via JMX 

• Collects data over an interval of 5 seconds
Java Thread Top - CPU
Java Thread Top - Contention
• Open source project 

• https://github.com/lifey/Java-threadTop

• connects to a process via JMX 

• Collects data over an interval of 5 seconds
Java Thread Top Memory
Allocation
Thanks
Q&A

Basic JVM Troubleshooting With Jmx