I have a mysql server running debian with 2GO of RAM. I would like to know the amount of memory used by each process.
I thought ps -aux was the command and options for it. But I only see 90 MO used by several processes and free -m tells me that 1400 MO are used.
Is there a way to have a better view with the processes and the memory used by them ?
srv-datax:~# free -m
total used free shared buffers cached
Mem: 2015 1476 539 0 0 70
-/+ buffers/cache: 1405 609
Swap: 486 0 486
You should post your free output so we know you are reading is correctly. Memory usage on Linux for a process is hard to nail down specifically, if you really want to get into the details and have a recent kernel, check
cat /proc/<pid>/smaps
.is a good option
lets you monitor all Threads
this kind of using '-U' switch lets you monitor user-specific listing
Top does a good job, look for these headers:
Another option along the same lines as what AbhishekKr suggested:
ps aux
will give you a breakdown of the memory used by every process on the system.VSZ => Virtual Size (physical RAM+swap used), RSS => Resident Size (physical RAM only).
The %MEM column reflects the % of physical RAM used if memory serves, I'm sure someone will correct me if I'm wrong :)
Adding to what Kyle Brandt suggested, you could use the Tool
pmap
which nicely summarizes the information found in /proc/<pid>/smap. If you use the-d
option, it will show you how much memory is mapped, shared and set private. This, IMHO, provides a good view.I can also suggest reading this interesting article about memory usage.