Linux free shows high memory usage but top does not

前端 未结 3 1598
旧时难觅i
旧时难觅i 2021-01-30 01:45

On RedHat Linux 6.2 I\'m running free -m and it shows nearly all 8GB used

             total       used       free     shared    buffer         


        
相关标签:
3条回答
  • 2021-01-30 02:02

    Also, as the first line shows total used free shared buffers cached Mem: 7989 7734 254 0 28 7128 -/+ buffers/cache: 578 7411

    If we add (cached[7128] + buffers[28] + free[254]), we will get approximately the second line's free[7411] value 7128 + 28 + 254 = 7410

    0 讨论(0)
  • 2021-01-30 02:04

    Don't look at the "Mem" line, look at the one below it.

    The Linux kernel consumes as much memory as it can to provide the I/O cache (and other non-critical buffers, but the cache is going to be most of this usage). This memory is relinquished to processes when they request it. The "-/+ buffers/cache" line is showing you the adjusted values after the I/O cache is accounted for, that is, the amount of memory used by processes and the amount available to processes (in this case, 578MB used and 7411MB free).

    The difference of used memory between the "Mem" and "-/+ buffers/cache" line shows you how much is in use by the kernel for the purposes of caching: 7734MB - 578MB = 7156MB in the I/O cache. If processes need this memory, the kernel will simply shrink the size of the I/O cache.

    0 讨论(0)
  • 2021-01-30 02:23

    If the cached is small, try this command:

    ps aux --sort -rss
    
    0 讨论(0)
提交回复
热议问题