58
JDK not so hidden treasures Andrzej Grzesik

JDK, the not so hidden treasures

Embed Size (px)

Citation preview

Page 1: JDK, the not so hidden treasures

JDK not so hidden treasuresAndrzej Grzesik

Page 2: JDK, the not so hidden treasures

andrzej grzesik@ags313

[email protected]

andrzejgrzesik.info

Page 3: JDK, the not so hidden treasures

@javazone @ags313please tweet!

Page 4: JDK, the not so hidden treasures

questions?just ask!

Page 5: JDK, the not so hidden treasures

java

Page 6: JDK, the not so hidden treasures

$JAVA_HOME/bin

Page 7: JDK, the not so hidden treasures
Page 8: JDK, the not so hidden treasures
Page 9: JDK, the not so hidden treasures

tl;dr: log gc please

Page 10: JDK, the not so hidden treasures

log gc :-)

Page 11: JDK, the not so hidden treasures

when things go…

Page 12: JDK, the not so hidden treasures
Page 13: JDK, the not so hidden treasures

does it run?

Page 14: JDK, the not so hidden treasures

top // htop

Page 15: JDK, the not so hidden treasures
Page 16: JDK, the not so hidden treasures

every known problem becomes completely new

when you add “in Java”

stolen from: @mryapee

Page 17: JDK, the not so hidden treasures

jpsinstead of ps

Page 18: JDK, the not so hidden treasures

jpsinstead of ps

Page 19: JDK, the not so hidden treasures

jps -lvmJava ProcesseS LoVe Memory

Page 20: JDK, the not so hidden treasures
Page 21: JDK, the not so hidden treasures
Page 22: JDK, the not so hidden treasures

jar

Page 23: JDK, the not so hidden treasures

jar -tf

Page 24: JDK, the not so hidden treasures
Page 25: JDK, the not so hidden treasures

jinfo

Page 26: JDK, the not so hidden treasures

demo

Page 27: JDK, the not so hidden treasures
Page 28: JDK, the not so hidden treasures

javac

Page 29: JDK, the not so hidden treasures

javacjust the compiler

Page 30: JDK, the not so hidden treasures

javap

Page 31: JDK, the not so hidden treasures
Page 32: JDK, the not so hidden treasures
Page 33: JDK, the not so hidden treasures

jmapinstead of pmap

Page 34: JDK, the not so hidden treasures
Page 35: JDK, the not so hidden treasures

and jhat

Page 36: JDK, the not so hidden treasures

demo

Page 37: JDK, the not so hidden treasures

stacktraces :)

Page 38: JDK, the not so hidden treasures

kill -3 <pid>

Page 39: JDK, the not so hidden treasures

demo

Page 40: JDK, the not so hidden treasures

caveat ;-)

Page 41: JDK, the not so hidden treasures

caveat ;-)prints to STDOUT of the running process

Page 42: JDK, the not so hidden treasures

jstack

Page 43: JDK, the not so hidden treasures
Page 44: JDK, the not so hidden treasures

caveatsonly at safepoints, one thread at a time

Page 45: JDK, the not so hidden treasures
Page 46: JDK, the not so hidden treasures
Page 47: JDK, the not so hidden treasures

demo

Page 48: JDK, the not so hidden treasures

jstat

Page 49: JDK, the not so hidden treasures

jstat <metric> <options> PID <interval> <count>

Page 50: JDK, the not so hidden treasures

demo

Page 51: JDK, the not so hidden treasures

custom optionshttp://hg.openjdk.java.net/jdk9/jdk9/jdk/file/d49e247dade6/src/jdk.jcmd/share/

classes/sun/tools/jstat/resources/jstat_options

Page 52: JDK, the not so hidden treasures

jstatd

Page 53: JDK, the not so hidden treasures

jstatdexposes your processes

Page 54: JDK, the not so hidden treasures

jcmd

Page 55: JDK, the not so hidden treasures

jvisualvm

Page 56: JDK, the not so hidden treasures

jmxsh

jmxtermhttp://wiki.cyclopsgroup.org/jmxterm

http://code.google.com/p/jmxsh/

and more

Page 57: JDK, the not so hidden treasures

questions?just shoot!

Page 58: JDK, the not so hidden treasures

Thank you!