Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • I've tried to get this working and it didn't give me interestening results. For example it only shows one program, and it isn't the one taking up the most of the memory Commented Oct 9, 2015 at 8:59
  • Is it? Well you want some thing like top?? if yes then you can modify the script with delay of 2 or 1 sec and run the same thing in some while or for. For me it shows the highest Memory usage Application at the time i run this Script. what kind of stuff you are trying, just run : ps af -o pmem,cmd | sort -r It will give you the highest mem usage application Commented Oct 9, 2015 at 9:28
  • It's not working for me. I guess the reason is that sort includes leading white space Commented Oct 9, 2015 at 10:52
  • You mean you are not getting correct name of process?? Commented Oct 9, 2015 at 12:33
  • Yes, beacuse ps add spaces to indent stuff. When one process has 2 digit usage one digit usage values will be indented and will start with leading space. I guess adding something like sed -e 's/^[[:space:]]*//' should fix it. Also does your script adds up memory usage of processes with same command? Commented Oct 9, 2015 at 12:39