Your SlideShare is downloading. ×
0
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
jps & jvmtop
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

jps & jvmtop

1,328

Published on

Slides accompanying a lightning talk I gave at the Altamira Fall 2013 conference.

Slides accompanying a lightning talk I gave at the Altamira Fall 2013 conference.

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,328
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
12
Comments
0
Likes
4
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. jps & jvmtop Scott Leberknight
  • 2. "How you monitor your software is as important as its functionality" - Nathan Marz, "Your Code is Wrong"
  • 3. jps Like ps, but lists Java processes
  • 4. jps
  • 5. jps -l (that's a lowercase L)
  • 6. jps -m
  • 7. jps -v
  • 8. jps -lmv (of course you can combine arguments...)
  • 9. monitor remote host jps foo.bar.com:6666 (a jstatd process must be running on remote host)
  • 10. beware tmpwatch! jps gets info from /tmp/hsperfdata_<username>/<pid>
  • 11. beware tmpwatch! (2)
  • 12. beware tmpwatch! (3) tmpwatch could delete hsperfdata files for long running VMs, e.g. Hadoop NameNode jps won't see JVMs if process file deleted! oops!
  • 13. jps summary list process id and class name options: -q: suppress class name -l: fully-qualified class name -m: arguments to main() -v: VM arguments -V: VM arguments via flag file
  • 14. jvmtop Like top, but for Java processes
  • 15. ./jvmtop.sh
  • 16. jvmtop columns PID: process id MAIN-CLASS: "jvm name"; class with main() method HPCUR: currently used heap memory HPMAX: maximum heap memory used NHCUR: current non-heap memory used (e.g. PermGen) NHMAX: maximum non-heap memory JVM can allocate
  • 17. jvmtop columns (2) CPU: the CPU utilization GC: % of time spent in garbage collection VM: information about the JVM (S6U31 = Sun 6, update 31) USERNAME: process owner #T: number of JVM threads DL: deadlock indicator (shows !D if deadlock detected)
  • 18. ./jvmtop.sh <pid>
  • 19. jvmtop detail columns TID: thread id NAME: thread name STATE: thread state CPU: the CPU utilization (relative to all processors) TOTALCPU: CPU utilization since thread started BLOCKEDBY: thread that is blocking a thread
  • 20. jvmtop profiler ./jvmtop.sh --profile <PID>
  • 21. References Nathan Marz, "Your Code is Wrong": www.slideshare.net/nathanmarz/your-code-is-wrong http://www.youtube.com/watch?v=QOu4e5y6sg4 jps: docs.oracle.com/javase/7/docs/technotes/tools/share/jps.html jstatd: docs.oracle.com/javase/7/docs/technotes/tools/share/jstatd.html jstack: docs.oracle.com/javase/7/docs/technotes/tools/share/jstack.html jvmtop project: code.google.com/p/jvmtop/
  • 22. My Info scott.leberknight@altamiracorp.com @gmail.com www.altamiracorp.com/blog www.sleberknight.com/blog twitter: sleberknight

×