JDK, the not so hidden treasures

Andrzej Grzesik
Andrzej GrzesikSoftware Developer at ebay
JDK not so hidden treasures
Andrzej Grzesik
andrzej grzesik
@ags313
andrzej@grzesik.it
andrzejgrzesik.info
@javazone @ags313
please tweet!
questions?
just ask!
java
$JAVA_HOME/bin
JDK, the not so hidden treasures
JDK, the not so hidden treasures
tl;dr: log gc
please
log gc :-)
when things go…
JDK, the not so hidden treasures
does it run?
top // htop
JDK, the not so hidden treasures
every known problem becomes completely new
when you add “in Java”
stolen from: @mryapee
jps
instead of ps
jps
instead of ps
jps -lvm
Java ProcesseS LoVe Memory
JDK, the not so hidden treasures
JDK, the not so hidden treasures
jar
jar -tf
JDK, the not so hidden treasures
jinfo
demo
JDK, the not so hidden treasures
javac
javac
just the compiler
javap
JDK, the not so hidden treasures
JDK, the not so hidden treasures
jmap
instead of pmap
JDK, the not so hidden treasures
and jhat
demo
stacktraces :)
kill -3 <pid>
demo
caveat ;-)
caveat ;-)
prints to STDOUT of the running process
jstack
JDK, the not so hidden treasures
caveats
only at safepoints, one thread at a time
JDK, the not so hidden treasures
JDK, the not so hidden treasures
demo
jstat
jstat <metric> <options> PID <interval> <count>
demo
custom options
http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/d49e247dade6/src/jdk.jcmd/share/
classes/sun/tools/jstat/resources/jstat_options
jstatd
jstatd
exposes your processes
jcmd
jvisualvm
jmxsh
jmxterm
http://wiki.cyclopsgroup.org/jmxterm
http://code.google.com/p/jmxsh/
and more
questions?
just shoot!
Thank you!
1 of 58

More Related Content

What's hot(20)

Nullcon Hack IM 2011 walk throughNullcon Hack IM 2011 walk through
Nullcon Hack IM 2011 walk through
Anant Shrivastava16.8K views
7 jvm-arguments-Confoo7 jvm-arguments-Confoo
7 jvm-arguments-Confoo
Tier1 app383 views
How to Setup A Pen test Lab and How to Play CTF How to Setup A Pen test Lab and How to Play CTF
How to Setup A Pen test Lab and How to Play CTF
n|u - The Open Security Community24.2K views
Lets crash-applicationsLets crash-applications
Lets crash-applications
Tier1 app227 views
7 jvm-arguments-v17 jvm-arguments-v1
7 jvm-arguments-v1
Tier1 app84 views
VS Debugging TricksVS Debugging Tricks
VS Debugging Tricks
Sasha Goldshtein10.7K views
Advanced Debugging with WinDbg and SOSAdvanced Debugging with WinDbg and SOS
Advanced Debugging with WinDbg and SOS
Sasha Goldshtein6.9K views
Lets crash-applicationsLets crash-applications
Lets crash-applications
Tier1 app293 views
C++ Production DebuggingC++ Production Debugging
C++ Production Debugging
Sasha Goldshtein1.9K views
BlockstackBlockstack
Blockstack
dantrevino195 views
Who’s afraid of WinDbgWho’s afraid of WinDbg
Who’s afraid of WinDbg
Dror Helper1.9K views
Spock frameworkSpock framework
Spock framework
Djair Carvalho438 views

Similar to JDK, the not so hidden treasures

Don't dump thread dumpsDon't dump thread dumps
Don't dump thread dumpsTier1 App
1.2K views22 slides
Don't dump thread dumpsDon't dump thread dumps
Don't dump thread dumpsTier1app
634 views26 slides
jcmd #javacasualjcmd #javacasual
jcmd #javacasualYuji Kubota
16.9K views42 slides

Similar to JDK, the not so hidden treasures(20)

Don't dump thread dumpsDon't dump thread dumps
Don't dump thread dumps
Tier1 App1.2K views
A Life of breakpointA Life of breakpoint
A Life of breakpoint
Hajime Morrita1.5K views
Don't dump thread dumpsDon't dump thread dumps
Don't dump thread dumps
Tier1app634 views
jcmd #javacasualjcmd #javacasual
jcmd #javacasual
Yuji Kubota16.9K views
Hanganalyze presentationHanganalyze presentation
Hanganalyze presentation
Leyi (Kamus) Zhang2.4K views
FreeBSD 2014 Flame GraphsFreeBSD 2014 Flame Graphs
FreeBSD 2014 Flame Graphs
Brendan Gregg17.8K views
x86x86
x86
Wei-Bo Chen2K views
Jaap : node, npm & gruntJaap : node, npm & grunt
Jaap : node, npm & grunt
Bertrand Chevrier31.5K views
jvm goes to big datajvm goes to big data
jvm goes to big data
srisatish ambati2K views
Osol PgsqlOsol Pgsql
Osol Pgsql
Emanuel Calvo673 views
Debug generic processDebug generic process
Debug generic process
Vipin Varghese200 views

More from Andrzej Grzesik(9)

The path to Repeatable BuildsThe path to Repeatable Builds
The path to Repeatable Builds
Andrzej Grzesik566 views
Go, the one language to learn in 2014Go, the one language to learn in 2014
Go, the one language to learn in 2014
Andrzej Grzesik1.2K views
Cheffing a departmentCheffing a department
Cheffing a department
Andrzej Grzesik623 views
Continuous Delivery AntipatternsContinuous Delivery Antipatterns
Continuous Delivery Antipatterns
Andrzej Grzesik2.7K views
Java 8: the good parts!Java 8: the good parts!
Java 8: the good parts!
Andrzej Grzesik10.7K views
Continuous DeliveryContinuous Delivery
Continuous Delivery
Andrzej Grzesik1.3K views
GitGit
Git
Andrzej Grzesik917 views
Continous deliveryContinous delivery
Continous delivery
Andrzej Grzesik1.3K views
Hbase jddHbase jdd
Hbase jdd
Andrzej Grzesik812 views

Recently uploaded(20)

Web Dev - 1 PPT.pdfWeb Dev - 1 PPT.pdf
Web Dev - 1 PPT.pdf
gdsczhcet49 views
The Research Portal of Catalonia: Growing more (information) & more (services)The Research Portal of Catalonia: Growing more (information) & more (services)
The Research Portal of Catalonia: Growing more (information) & more (services)
CSUC - Consorci de Serveis Universitaris de Catalunya59 views
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf
Eleanor McHugh36 views
Tunable Laser (1).pptxTunable Laser (1).pptx
Tunable Laser (1).pptx
Hajira Mahmood21 views
Java Platform Approach 1.0 - Picnic MeetupJava Platform Approach 1.0 - Picnic Meetup
Java Platform Approach 1.0 - Picnic Meetup
Rick Ossendrijver24 views