For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > January 2008 > JVM thread monitoring









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author JVM thread monitoring
Anirban Adhikary

2008-01-31, 4:19 am

Dear list
Is it possible to check the %CPU,%MEM usage of each thread produced by a
JVM by using a perl script??? If yes then is there any particular module
for it? If there is any link available for the above question over the web
then pls let me know....

Thanks&Regards
Anirban Adhikary.

Jerald Sheets

2008-01-31, 7:13 pm

> Is it possible to check the %CPU,%MEM usage of each thread produced
> by a
> JVM by using a perl script??? If yes then is there any particular
> module



I'd probably use some of the more esoteric of the $JAVA_OPTS availalbe
at Sun's site to get more detailed logging, and then parse the logfile
for the info you need.

For instance:

you can use the jmap feature and get a heap histogram:

jmap -histo <PID>

or you can get heap metrics:

jmap -heap <PID>

Also check out the fields you can get from the Heap Profiler:

java -agentlib:hprof


Most of that output can be regexed out.


Any of that can be run via system() and then just parse through for
what you're looking for. There are other utilities out there, I'm
sure, but this is how I would do it.


(I do Apache+Tomcat+Java for The Weather Channel)

--jms
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com