total,即所有可用内存,值为物理内存扣掉一些保留的比特位(多少?)及解压后放到内存中的内核。
used(“Mem:”行),扣除空闲内存(free)后的内存容量。
free(“Mem:”行),LowFree和HighFree之和,系统当前未使用的内存总量。HighFree,该区域不是直接映射到内核空间。内核必须使用不同的手法使用该段内存。(Starting with Linux 2.6.19, CONFIG_HIGHMEM is required.) Total amount of highmem. Highmem is all memory above ~860MB of physical memory. Highmem areas are for use by user-space programs, or for the page cache. The kernel must use tricks to access this memory, making it slower to access than lowmem.
LowFree,低位可以达到高位内存一样的作用,而且它还能够被内核用来记录一些自己的数据结构。(Starting with Linux 2.6.19, CONFIG_HIGHMEM is required.) Total amount of lowmem. Lowmem is memory which can be used for everything that highmem can be used for, but it is also available for the kernel’s use for its own data structures. Among many other things, it is where everything from Slab is allocated. Bad things happen when you’re out of lowmem.
shared,仅共享内存?还是所有进程间通信资源的总和?
buffers,用来给文件做缓冲大小。 Relatively temporary storage for raw disk blocks that shouldn’t get tremendously large (20MB or so).
cached,被高速缓冲存储器(cache memory)用的内存的大小(等于diskcache minus SwapCache).
swap,swap分区的使用情况,swap分区在磁盘分区时确定。被高速缓冲存储器(cache memory)用的交换空间的大小已经被交换出来的内存,但仍然被存放在swapfile中。用来在需要的时候很快被替换而不需要再次打开I/O端口。Memory that once was swapped out, is swapped back in but still also is in the swap file. (If memory pressure is high, these pages don’t need to be swapped out again because they are already in the swap file. This saves I/O.)。
used(“-/+ buffers/cache:”行),used[2] = used[1] - buffers - cached
free(“-/+ buffers/cache:”行),free[2] = free[1] + buffers + cached