This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Performance and the fly likes Measure JVM CPU using ps/top etc using Linux commands Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Performance
Bookmark "Measure JVM CPU using ps/top etc using Linux commands" Watch "Measure JVM CPU using ps/top etc using Linux commands" New topic
Author

Measure JVM CPU using ps/top etc using Linux commands

Gautam Raj Singh
Greenhorn

Joined: Sep 23, 2005
Posts: 1
Hi,

I need to develop a perl/shell script using linux commands only for finding out how much CPU, Memory and other stats for JVMs on our WAS servers.
Problem is when using `top` the JVM keeps forking out many different process and whose cpu keeps spiking so making it difficult to monitor. Do I need to add cpu usage/memory child process of JVMs PID and

I need to whats the best way to tackle this problem?

Regards
Gautam
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 20055
    
  44

For Linux, one consideration is procfs. You can get live information, just by reading files. There are a bunch of files in /proc that gives you the state of the system. And a bunch more in /proc/PID that will give you the state of a particular process.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Measure JVM CPU using ps/top etc using Linux commands
 
It's not a secret anymore!