File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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: 18973
    
  40

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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Measure JVM CPU using ps/top etc using Linux commands