Correct understanding of Linux memory usage is too high

  
 

When Linux is booted, use the top command to view that 4G physical memory has been used up to 3.2G, and the occupancy rate is over 80%:

Mem: 3889836k total, 3341868k used, 547968k free, 286044k buffers

Swap: 6127608k total, 0k used, 6127608k free, 1554888k cached

The red number part above, use free to view the results as follows:

[root@rd01 ~]# free -m

total used free shared buffers cached

Mem: 3798 3264 534 0 279 1518

-/+ buffers/cache: 1466 2332

Swap : 5983 0 5983 The red digital part has been using the memory and it is already 3264M. Does it mean that the system memory really takes up so much? It only runs a website, it is impossible to take up so much! Pay attention to the blue bottom part. This part indicates the memory used by the system cache. This part of the memory can be allocated to the process at any time. Therefore, the real remaining memory should be free under 534+2332=2866M, so the remaining physical memory should be 2866M. Not 534M.

Therefore, the memory that is currently being used by the process is used-used-(buffers+cache). It can also be considered that if the swap is not used in a large amount, the mem is still sufficient, and only the mem is actually occupied by the current process ( Without buffers and cache), swap will be used.

Copyright © Windows knowledge All Rights Reserved