Compared with top, the free Command provides a more concise view of the system memory usage: [root @ castal ~] # Free-mtotalusedfreesharedbufferscachedMem: 502463390
Compared with top, the free Command provides a more concise view of the system memory usage:
[root@castal ~]# free -m total used free shared buffers cachedMem: 502 463 39 0 102 250-/+ buffers/cache: 110 392Swap: 1027 7 1020
Mem: physical memory statistics
-/+ Buffers/cached: indicates the cache statistics of physical memory.
Swap: indicates the usage of Swap partitions on the hard disk.
The total physical memory of the system is 255988Kb (256 MB), but the actual available memory of the system is not 24284Kb marked as free in the first line. it only indicates the unallocated memory.
Total: total physical memory.
Used: indicates the total quantity allocated to the cache (including buffers and cache), but some of the caches are not actually used.
Free: unallocated memory.
Shared: shared Memory, which is generally not used by the system and will not be discussed here.
Buffers: Number of buffers allocated by the system but not used.
Cached: number of cache allocated by the system but not used. The difference between buffer and cache is described later.
Used2: the total amount of actually used buffers and cache, which is also the total amount of actually used memory.
Free2: the sum of unused buffers, cache, and unallocated memory, which is the actual available memory of the system.
The following equations can be sorted out:
Total = used + free
Total = used2 + free2
Used = buffers + cached + used2
Free2 = buffers + cached + free
Difference between buffer and cache
A buffer is something that has yet to be "written" to disk.
A cache is something that has been "read" from the disk and stored for later use.