how to check how much memory processes take?

1

As we know in Linux machines, we have RAM memory and swap memory.

My first question is:

What is the reason that the swap memory is increasing – because high level of using the RAM memory or something else?

Second - is it possible to verify how much memory a process holds?

example from top command:

Is it possible to calculate how much memory the watchdog process uses?

 Tasks: 107 total,   1 running, 106 sleeping,   0 stopped,   0 zombie
 Cpu(s):  0.8%us,  0.5%sy,  0.0%ni, 98.0%id,  0.5%wa,  0.0%hi,  0.1%si,  0.0%st
 Mem:   2075440k total,  2011396k used,    64044k free,   120452k buffers
 Swap:  4192924k total,  1554096k used,  2638828k free,  1418852k cached

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                                  
 1 root      15   0  2160  600  544 S  0.0  0.0   1:00.91 init                                                                                                                                                      
 2 root      RT  -5     0    0    0 S  0.0  0.0   0:04.50 migration/0                                                                                                                                               
 3 root      34  19     0    0    0 S  0.0  0.0   0:00.16 ksoftirqd/0                                                                                                                                               
 4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.01 watchdog/0   

maihabunash

Posted 2015-06-10T07:59:03.860

Reputation: 479

Answers

2

Swap is indeed used when all RAM is allocated.

The watchdog process is actually a kernel thread so you can't get its specific memory usage as it is part of the kernel.

A regular process RAM usage is reported by the RES column (resident).

jlliagre

Posted 2015-06-10T07:59:03.860

Reputation: 12 469