top 5 java processes taking max memory

dear experts

I am running 10 java processes in my linux box.
Is there a way to find out which of my 5 java processes are taking the maximum memory?

thanks
royjaydAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Raymond van den BedumCommented:
Hello,

try using:
ps -aux | grep java
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
woolmilkporcCommented:
Try "jvmtop"

Info and download here:

https://code.google.com/p/jvmtop/

This is from the docs:

jvmtop is a pure java console utility which is able to monitor all accessible jvms running on the same machine at once and to display jvm metrics which standard operating system tools cannot provide.

It can be seen as an alternative for the jconsole but because of its console nature it can be easilier used in specific environments and has less requirements (e.g. X11). Another advantage is that jvmtop shows you the most important, live metrics of all running jvms at once - in a top-like manner.

If you don't want to download additional software - there is still "jconsole":

The JConsole graphical user interface is a monitoring tool that complies to the Java Management Extensions (JMX) specification. JConsole uses the extensive instrumentation of the Java Virtual Machine (Java VM) to provide information about the performance and resource consumption of applications running on the Java platform.

jconsole lives in JDK_HOME/bin. "JDK_HOME" means the JDK installation directory.
0
stivostenbergCommented:
If you are accessing your system locally with a GUI then JConsole is great, but if you are accessing over the network without a gui you are kinda stuck.  Your options at that point are to use "JMXTerm" which is  a commandline version of JConsole. I wrote up a brief example using JMXTerm here:

http://www.codeproject.com/Articles/989746/JMXTerm-Interactive-and-Scripted

I am also working on a project that just dumps all the MBeans from a server, with optional filters.  I need to make it a little more targetable, but it is working now:

https://github.com/StivOstenberg/BeanBagger
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.