1
votes

I am looking for a way to pull heap sizes (min, max, used) from a Java process on Linux. I need a lightwaight tool/command to use to do the job. Big monitoring packages are not an option.

I done some googleing and more but could not find a viable alternatives. The only possible option that I found so far is to use JMX protocol. I enabled JMX on Java appication and was succesfully poll it using various java tools that use JMX protocol/library implementation. But these Java tools are slow, taking much cpu during startup when allocating memory. What I want is a simple tool command line that would talk for example JMX protocol and poll the process for heap sizes.

I am using IBM's J9 version of Java and jstat tool is not available there.

Any ideas anyone?

1
You can try JProfiler a tool for heap analysis. Or JVisualVm shipped along with jdk for that purpose. - Darshan Lila
It takes about 15 lines of code to poll the JMX yourself. - nablex
nablex where can I find those 15 lines of code. JMX is a non http protocol and one cannot easily talk to it. Do you mean 15 lines of Java code? I already have a Java client but It's slow and takes CPU if I run it on tenths of servers almost at the same time. Can you elaborate a little more? - bortek

1 Answers

1
votes

Your need has probably been taken care of by now but one option, for others who might stumble on this thread, is a tool called 'jvmtop' (link: https://code.google.com/p/jvmtop/). It works with the IBM J9 JVM (among others).