Monitoring all running and spawning JVMs [closed]

By : Zofren
Source: Stackoverflow.com
Question!

I have a 8Go compilation server, running a Jenkins instance, a Jenkins slave agent. All jobs run the same script sh. This script launches others scripts and a big ant build. In this build, several JVM can be launched (javac with fork, junitreports, etc etc ...).

I need to track a OutOfMemoryError. But I can't monitor the spawned Java processes with a tool because they are temporary.

I'm searching for a tool tracking all current and future JVM running on the server, and displaying memory graphs. Does it exist ?

By : Zofren


Answers

I have never heard of such a tool.

But you can do something similar with a shell script running periodically

jps | grep -v -i 'jps'  | cut -d' ' -f 1 | xargs -n1 jmap -heap


I would suggest running JConsole. It's free and a really easy tool to profile. You can track objects life, quality of the application (By examining the Eden Space area and other areas). You can get a complete memory usage analysis of your JVM.

By default, you get JConsole when you download JDK.

By : mreaper


This video can help you solving your question :)
By: admin