How much memory is a specific user using

memoryusers

Is it possible to find out how much memory I am using on a multiuser linux machine? I want to know whether I am using a lot of memory and possibly inconveniencing others, so I can shut down my processes if necessary.

I've seen in another question that sa -m might do it, but I apparently don't have access to that command on this server.

Edit: I don't have sudo access, so I can't install stuff. The server is CentOS.

Best Answer

You can use ps together with awk to find the physical memory usage by a user:

ps -U root --no-headers -o rss | awk '{ sum+=$1} END {print int(sum/1024) "MB"}'

Here it prints memory used by root to the output.

Related Question