SlideShare a Scribd company logo
jps & jvmtop

Scott Leberknight
"How you monitor your
software is as important as
its functionality"
- Nathan Marz, "Your Code is Wrong"
jps

Like ps, but lists Java processes
jps
jps -l
(that's a lowercase L)
jps -m
jps -v
jps -lmv
(of course you can combine arguments...)
monitor remote host

jps foo.bar.com:6666

(a jstatd process must be running on remote host)
beware tmpwatch!
jps gets info from /tmp/hsperfdata_<username>/<pid>
beware tmpwatch! (2)
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!
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
jvmtop

Like top, but for Java processes
./jvmtop.sh
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
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)
./jvmtop.sh <pid>
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
jvmtop profiler
./jvmtop.sh --profile <PID>
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/
My Info
scott.leberknight@altamiracorp.com

@gmail.com

www.altamiracorp.com/blog

www.sleberknight.com/blog
twitter: sleberknight

More Related Content

PPTX
Defcon 20 stamp out hash corruption crack all the things
PDF
JDK, the not so hidden treasures
PDF
Nine Circles of Inferno or Explaining the PostgreSQL Vacuum
PPTX
Job Automation using Linux
ODP
PDF
Python Subprocess
PPTX
Nmap 9 truth "Nothing to say any more"
DOCX
Linux crontab
Defcon 20 stamp out hash corruption crack all the things
JDK, the not so hidden treasures
Nine Circles of Inferno or Explaining the PostgreSQL Vacuum
Job Automation using Linux
Python Subprocess
Nmap 9 truth "Nothing to say any more"
Linux crontab

What's hot (11)

PDF
Tsung Intro presentation 2013
PDF
ODP
Easy distributed load test with Tsung
PDF
RabbitMQ for Perl mongers
PDF
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
KEY
Prepare for PHP Test Fest 2009
PDF
java-monitoring-troubleshooting
PPTX
Java performance
PDF
CRONtab Tutorial
PDF
PPTX
Using linux in schools
Tsung Intro presentation 2013
Easy distributed load test with Tsung
RabbitMQ for Perl mongers
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
Prepare for PHP Test Fest 2009
java-monitoring-troubleshooting
Java performance
CRONtab Tutorial
Using linux in schools
Ad

Viewers also liked (18)

PDF
RESTful Web Services with Jersey
PDF
Dropwizard
PDF
AWS Lambda
PDF
CoffeeScript
PDF
Polyglot Persistence
PDF
Cloudera Impala, updated for v1.0
PDF
wtf is in Java/JDK/wtf7?
PDF
Cloudera Impala
PDF
Java 8 Lambda Expressions
PDF
HBase Lightning Talk
PDF
Google Guava
PDF
Apache ZooKeeper
PDF
Awesomizing your Squarespace Website
ODP
Introduction to AWS IAM
RESTful Web Services with Jersey
Dropwizard
AWS Lambda
CoffeeScript
Polyglot Persistence
Cloudera Impala, updated for v1.0
wtf is in Java/JDK/wtf7?
Cloudera Impala
Java 8 Lambda Expressions
HBase Lightning Talk
Google Guava
Apache ZooKeeper
Awesomizing your Squarespace Website
Introduction to AWS IAM
Ad

Similar to jps & jvmtop (20)

PDF
Java Performance Analysis on Linux with Flame Graphs
PDF
Beginner's Guide to the nmap Scripting Engine - Redspin Engineer, David Shaw
PDF
JavaOne 2015 Java Mixed-Mode Flame Graphs
DOCX
Unix commands
PDF
Spark 101
PDF
Command Line Applications with Ruby
PDF
Flame Graphs for MySQL DBAs - FOSDEM 2022 MySQL Devroom
PDF
jcmd #javacasual
PDF
Jaap : node, npm & grunt
PPTX
PPTX
Shooting the troubles: Crashes, Slowdowns, CPU Spikes
ODP
Dynamic Tracing of your AMP web site
ODP
Владимир Перепелица "Модули"
PDF
Debugging Ruby Systems
PDF
Open Source Debugging v1.3.2
PPTX
.Net debugging 2017
PDF
FunctionalJS - May 2014 - Streams
PDF
Functional Programming with Streams in node.js
PPTX
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
PPTX
Tuning Elasticsearch Indexing Pipeline for Logs
Java Performance Analysis on Linux with Flame Graphs
Beginner's Guide to the nmap Scripting Engine - Redspin Engineer, David Shaw
JavaOne 2015 Java Mixed-Mode Flame Graphs
Unix commands
Spark 101
Command Line Applications with Ruby
Flame Graphs for MySQL DBAs - FOSDEM 2022 MySQL Devroom
jcmd #javacasual
Jaap : node, npm & grunt
Shooting the troubles: Crashes, Slowdowns, CPU Spikes
Dynamic Tracing of your AMP web site
Владимир Перепелица "Модули"
Debugging Ruby Systems
Open Source Debugging v1.3.2
.Net debugging 2017
FunctionalJS - May 2014 - Streams
Functional Programming with Streams in node.js
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Tuning Elasticsearch Indexing Pipeline for Logs

More from Scott Leberknight (6)

PDF
JShell & ki
PDF
JUnit Pioneer
PDF
JDKs 10 to 14 (and beyond)
PDF
Unit Testing
PDF
PDF
JShell & ki
JUnit Pioneer
JDKs 10 to 14 (and beyond)
Unit Testing

Recently uploaded (20)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
Approach and Philosophy of On baking technology
PDF
Electronic commerce courselecture one. Pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
KodekX | Application Modernization Development
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPT
Teaching material agriculture food technology
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Cloud computing and distributed systems.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
“AI and Expert System Decision Support & Business Intelligence Systems”
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Modernizing your data center with Dell and AMD
Approach and Philosophy of On baking technology
Electronic commerce courselecture one. Pdf
Understanding_Digital_Forensics_Presentation.pptx
Chapter 3 Spatial Domain Image Processing.pdf
KodekX | Application Modernization Development
NewMind AI Monthly Chronicles - July 2025
Network Security Unit 5.pdf for BCA BBA.
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Teaching material agriculture food technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Cloud computing and distributed systems.
Dropbox Q2 2025 Financial Results & Investor Presentation

jps & jvmtop