Find processes consuming memory in Linux

Is there a way to find out what processes are consuming how much memory (in kb or mb ) in linux.
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.

run the command top

First find the process id or process name like java etc

then :

# ps -eHo user,pid,ppid,ni,pri,pcpu,rsz,vsz,cmd | grep pid or process name

Main concentration on rsz and vsz of the process

RSZ : Resident set size (the amount of physical memory), in kilobytes. (RSZ for rsz; otherwise RSS)
VSZ : Virtual memory size, in kilobytes of the entire process. (VSZ)

Or you can follow in more advance : 
Monis MontherSystem ArchitectCommented:
I usualy run this and look at the RSS field. this will sort the proccess by physical memory usage (The most being at the bottom so you dont need to scroll up).

The RSS field is the same as the RSZ mensioned in the previous post (Physical Memory Used)

ps ax -yl --sort:rss

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
sanpradeepAuthor Commented:
The top command is not what I was looking for. I wanted the amount of memory utilized by processes.

Thanks for the solution..
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 OS Dev

From novice to tech pro — start learning today.