Toni
Toni

Reputation: 200

command line to get the memory used by process

What command line should I write to display the memory used by process as well as the process command line and it's pid ?

Something like:

pid mem cmdline
--- --- -------
112 12M mysql -param1 5 -param2 12
115 15M apache -param1 44 -param2 8
...

Upvotes: 5

Views: 1367

Answers (2)

xtofl
xtofl

Reputation: 41509

Wasn't there something like the /proc directory? /proc/[id]/mem should lead you there.

Upvotes: 0

Norbert Hartl
Norbert Hartl

Reputation: 10841

try

ps -eo pid,rss,cmd

Upvotes: 9

Related Questions