Understanding “Buffers” and “Cached” from free command

前端 未结 5 1198
独厮守ぢ
独厮守ぢ 2021-01-30 11:47

This has been asked earlier but don\'t want to update the same thread again as it was a old thread .

Want to clarify myself on the \"buffers\" and \"cache\" column from

5条回答
  •  抹茶落季
    2021-01-30 12:18

    The column headers in the free command are somewhat mislabeled, at least from the point of view of a linux user (as opposed to developer). Below is a clarification of what the headings mean:

    total: Yes, this is total ram.

    used: This is probably the most confused column. This is a mix of application used memory and other 'temporarily' (buffer + cache) used memory that is actually available if needed. So technically the memory is truly being used, but much of this memory is available if an application needs it. The 'temporarily' used memory is borrowed if available by the linux system to help speed up system performance, otherwise the system would have read from disk more often. Much of this type of memory is shown under the 'cached' column. This memory is given up by the linux system if an application need memory.

    free: Yes, this pure free and untouched memory.

    shared: Memory specifically allocated for use by multiple processes

    buffers: Temporary memory that is set aside to help some processes

    cache: Memory that is available and 'borrowed' by the operating system to help speed up many linux OS operations. This memory is given up by the system if an application need it.

    The line that starts with -/+ buffers/cache is typically more helpful than the first Mem line. The intersection of free and -/+ buffers/cache is essentially what you have for 'available' memory.

提交回复
热议问题