Wednesday, January 10, 2018

How to find process using high memory in Linux

Learn how to find process using high memory on linux server. This helps in tracking down issues and troubleshooting utilization problems.

Many times you came to know system memory is highly utilized using utility like sar. You want to find processes hogging on memory. To find that, we will be using sort function of process status ps command in this article. We will be sorting ps output with RSS values. RSS is Resident Set Size. This values shows how much memory from physical RAM allocated to particular process. It does not include swapped out memory numbers. Since, we troubleshooting processes using high physical memory RSS fits for our criteria.
Lets see below example :
In above output we sorted processes with RSS and shown only top 10 one. RSS value in output is in Kb. Lets verify this output for top most process with pid 14400.
On our system we have 264611456Kb physical RAM (highlighted entry in above output). Out of which 11.8% is used by process 14400 (from ps output above) which comes to 31224151Kb. This value matches RSS value of 31420276Kb (in ps output above)!
So above method works good when you try to find processes using highest physical memory on system!
You can even use another methods to get high memory using processes like top, htop etc. but this article aimed at using ps.

No comments:

Post a Comment