free -m
total used free shared buffers cached
Mem: 48269 2424 45845 0 139 1120
-/+ buffers/cache: 1164 47105
Swap: 8197 0 8197
total used free shared buffers cached
Mem: A B C D E F
-/+ buffers/cache: G H
Swap: I J K
Note:
A=B+C
A=G+H
G=B-E-F
H=C+E+F
The display columns mean:
- total: Your total (physical) RAM (excluding a small bit that the kernel permanently reserves for itself at startup); that's why it shows ca. 11.7 GiB , and not 12 GiB, which you probably have
- use: memory in use by the OS
- free: memory not in use
total=use+free
- shared/buffers/cached: This shows memory usage for specific purposes; the numbers are included in the value for "use". This is why the second line gives the numbers for used/free minus the sum cached+buffers.
The first line is about your physical memory (RAM), the last line "swap" gives the same information about swap space usage (i.e. memory contents that have been temporarily moved to disk). The second line gives the numbers for used/free minus the sum cached+buffers (because that value is often more meaningful).
To actually understand what the numbers mean, you need a bit of background about the virtual memory (VM) subsystem in Linux. Just a short version: Linux (like most modern OS) will always try to use free RAM for caching stuff, so "free" will almost always be very low. Therefore the line "/+ buffers/cache:" is shown, because it shows how much memory is free when ignoring caches; caches will be freed automatically if memory gets scarce, so they do not really matter.
A Linux system is really low on memory if the free value in "/+ buffers/cache:" gets low.
For more details about the meaning of the numbers, see e.g. the questions:
本文详细解析了Linux系统的内存使用情况报告,包括物理内存(RAM)和交换空间(swap)的使用状态。通过理解报告中的各项指标,如buffers、cache等,帮助读者深入掌握Linux内存管理机制。
590

被折叠的 条评论
为什么被折叠?



