Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
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
tl;dr: log gc
please
log gc :-)
when things go…
does it run?
top // htop
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
jar
jar -tf
jinfo
demo
javac
javac
just the compiler
javap
jmap
instead of pmap
and jhat
demo
stacktraces :)
kill -3 <pid>
demo
caveat ;-)
caveat ;-)
prints to STDOUT of the running process
jstack
caveats
only at safepoints, one thread at a time
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/resou...
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!
JDK, the not so hidden treasures
JDK, the not so hidden treasures
JDK, the not so hidden treasures
JDK, the not so hidden treasures
JDK, the not so hidden treasures
JDK, the not so hidden treasures
JDK, the not so hidden treasures
JDK, the not so hidden treasures
JDK, the not so hidden treasures
JDK, the not so hidden treasures
JDK, the not so hidden treasures
JDK, the not so hidden treasures
JDK, the not so hidden treasures
JDK, the not so hidden treasures
Upcoming SlideShare
Loading in …5
×

JDK, the not so hidden treasures

1,456 views

Published on

There is a number of tools that are as part of a JDK installation.
Often, you can rely only on these successfully analyse issues, without the need to resort to (often expensive) 3rd party tools. What is better, these being part of the JDK, they can be used as early as development and testing!

Taking and analysing memory dumps, stack traces of java processes running in a particular system, monitoring GC activity.. and more, command line as you would hope when accessing this well-protected machine in a data centre somewhere far.
This session will iterate through a number of such tools, discuss purpose and capabilities. All followed with demonstrations of most common usages.

Unleash the power of the tools that you already have, today!

Published in: Technology
  • Be the first to comment

JDK, the not so hidden treasures

  1. 1. JDK not so hidden treasures Andrzej Grzesik
  2. 2. andrzej grzesik @ags313 andrzej@grzesik.it andrzejgrzesik.info
  3. 3. @javazone @ags313 please tweet!
  4. 4. questions? just ask!
  5. 5. java
  6. 6. $JAVA_HOME/bin
  7. 7. tl;dr: log gc please
  8. 8. log gc :-)
  9. 9. when things go…
  10. 10. does it run?
  11. 11. top // htop
  12. 12. every known problem becomes completely new when you add “in Java” stolen from: @mryapee
  13. 13. jps instead of ps
  14. 14. jps instead of ps
  15. 15. jps -lvm Java ProcesseS LoVe Memory
  16. 16. jar
  17. 17. jar -tf
  18. 18. jinfo
  19. 19. demo
  20. 20. javac
  21. 21. javac just the compiler
  22. 22. javap
  23. 23. jmap instead of pmap
  24. 24. and jhat
  25. 25. demo
  26. 26. stacktraces :)
  27. 27. kill -3 <pid>
  28. 28. demo
  29. 29. caveat ;-)
  30. 30. caveat ;-) prints to STDOUT of the running process
  31. 31. jstack
  32. 32. caveats only at safepoints, one thread at a time
  33. 33. demo
  34. 34. jstat
  35. 35. jstat <metric> <options> PID <interval> <count>
  36. 36. demo
  37. 37. custom options http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/d49e247dade6/src/jdk.jcmd/share/ classes/sun/tools/jstat/resources/jstat_options
  38. 38. jstatd
  39. 39. jstatd exposes your processes
  40. 40. jcmd
  41. 41. jvisualvm
  42. 42. jmxsh jmxterm http://wiki.cyclopsgroup.org/jmxterm http://code.google.com/p/jmxsh/ and more
  43. 43. questions? just shoot!
  44. 44. Thank you!

×