The thread dump identifies the application and JVM threads present in the JVM at the time of the dump. It provides information on each thread's state, stack trace and timing details. It also includes a summary of JVM heap utilization broken down by generation. This information can help identify potential blocking issues, performance bottlenecks or memory leaks in the application.
5. • Why is the application slow?
• Why does the application have hiccups?
• Why is CPU pegged?
• Why are we running out of memory?
• …
• Why _______ ?
Landscape - Pain points
9. ####
Measure Anything, Measure Everything
!
“ If Engineering at Etsy has a religion, it’s the Church of
Graphs. If it moves, we track it …”
http://codeascraft.com/2011/02/15/measure-anything-measure-everything/
11. • Complex apps architecture and environments
• Insufficient historical data
• Weak inter-systems correlation
• Platforms disparity
• No one size fits all
• Folklore, outdated information
• High barrier to entry for effective diagnostics
Landscape - Challenges
23. JMX - Java Management Extensions
• De facto standard
• Wide support
• RMI not firewall friendly, dynamic ports
• RMI connector heavy, Observer effect
• MBeans need to behave
30. -X are non-standard, not guaranteed to be supported on all VM
implementations, and are subject to change without notice in
subsequent releases of the JDK.
!
$ java -X
…
-Xloggc:<file> log GC status to a file with time stamps
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size
-Xprof output cpu profiling data
…
Flags
31. -XX are not stable and are subject to change without notice
!
Boolean
-XX:+<option> or -XX:-<option>
!
Numeric
-XX:<option>=<number>[unit]
Unit:‘k’,‘K’,‘m’,‘M’,‘g’,‘G’ - 32768 or 32k
!
String
-XX:<option>=<string>
Flags
48. Thread Dump
"main" prio=5 tid=0x0000000101028800 nid=0x507 runnable [0x00007fff5fbfd000]
java.lang.Thread.State: RUNNABLE
at org.eclipse.swt.internal.cocoa.OS.objc_msgSend_bool(Native Method)
at org.eclipse.swt.internal.cocoa.NSRunLoop.runMode(NSRunLoop.java:42)
at org.eclipse.swt.widgets.Display.sleep(Display.java:4565)
at org.eclipse.ui.application.WorkbenchAdvisor.eventLoopIdle(WorkbenchAdvisor.java:364)
at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor.eventLoopIdle(IDEWorkbenchAdvisor.java:917)
at org.eclipse.ui.internal.Workbench$3.eventLoopIdle(Workbench.java:459)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1026)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:585)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
53. Thread Dump
PSYoungGen total 75776K, used 69708K [0x07f55, 0x07fb48, 0x08)
eden space 75264K, 92% used [0x07f550,0x07f98fb028,0x07f9e8)
from space 512K, 18% used [0x07fa18,0x07fa1980,0x07fa20)
to space 11264K, 0% used [0x07fa98,0x07fa98,0x07fb48)
!
ParOldGen total 59392K, used 46432K [0x07e0, 0x07e3a0, 0x07f550)
object space 59392K, 78% used [0x07e0,0x07e2d58270,0x07e3a0)
!
PSPermGen total 71680K, used 47149K [0x07d0, 0x07d460, 0x07e0)
object space 71680K, 65% used [0x07d0,0x07d2e0b6c8,0x07d460)
54. Thread Dump
“Thread I" prio=5 tid=0x0100 nid=0x1ef runnable [0x01acff]
java.lang.Thread.State: RUNNABLE
!
“Thread 3" prio=5 tid=0x0300 nid=0x3dd in Object.wait() [0x0366]
java.lang.Thread.State:TIMED_WAITING (on object monitor)
!
“Thread 4" prio=5 tid=0x0400 nid=0x4ab in Object.wait() [0x0477]
java.lang.Thread.State:WAITING (on object monitor)
!
“Thread 5" prio=5 tid=0x0500 nid=0x5bd waiting for monitor entry [0x0523]
java.lang.Thread.State: BLOCKED (on object monitor)
!
“Thread 2" prio=5 tid=0x0200 nid=0x2ef waiting on condition [0x02b8]
java.lang.Thread.State:TIMED_WAITING (sleeping)
!
“Thread 6" prio=5 tid=0x0600 nid=0x6ef waiting on condition [0x06b8]
java.lang.Thread.State: TIMED_WAITING (sleeping)
66. • Objects structure overhead
!
• Collections waste
» Fill ratio consideration
» Never shrink
» Up to 2 x expansion algorithms
!
• Use of Finalizers, 2 x GC cycles
OOEM - Application