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?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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:

try using:
ps -aux | grep java

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
Try "jvmtop"

Info and download here:

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.
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:

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:
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

From novice to tech pro — start learning today.