fanchyna
fanchyna

Reputation: 2713

which process is using my memory?

I have basically shut down all the processes but I still get 18GB used by running the "top" command:

top - 11:23:34 up 2 days, 19:20,  2 users,  load average: 0.00, 0.00, 0.00
Tasks: 202 total,   1 running, 201 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  32940056k total, 19210460k used, 13729596k free,   182428k buffers
Swap:  2031608k total,        0k used,  2031608k free, 18688628k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                        
32326 csxbot    15   0 12760 1168  812 R  0.3  0.0   0:00.02 top                                                             
    1 root      15   0 10368  700  584 S  0.0  0.0   0:02.17 init                                                            
    2 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 migration/0                                                     
    3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0                                                     
    4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/0                                                      
    5 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 migration/1                                                     
    6 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/1                                                     
    7 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/1  

What process is using my 19GB of memory? My OS is RHEL 6. How to check that.

----------------------------- UPDATED ------------------------- The "free" command basically gives the same results. Since this update is a few hours after my original post, the exact numbers could be different, but the large cache phenomenon still exists: 15GB of space is cached.

             total       used       free     shared    buffers     cached
Mem:         32168      15592      16575          0         76      14813
-/+ buffers/cache:        702      31465
Swap:         1983          0       1983

Upvotes: 2

Views: 4766

Answers (2)

ivica
ivica

Reputation: 1428

That is cached memory. It is used to cache data from hard drives into RAM, and used from RAM when needed. RAM is much faster than hard drive in terms of read/write speed.

This behavior is completely normal for Linux OS. If some of your processes needed more RAM, some of the cached data will be "freed" and that amount of RAM would become available to processes. Kernel takes care of all that, don't worry.

Upvotes: 6

CyberDem0n
CyberDem0n

Reputation: 15036

18688628k cached

About 18 GB used for caching IO operations

Upvotes: 3

Related Questions