Linux free shows high memory usage but top does not

前端 未结 3 1597
旧时难觅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: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.

提交回复
热议问题