free命令:
usage: free [-b|-k|-m|-g] [-l] [-o] [-t] [-s delay] [-c count] [-V]
-b,-k,-m,-g show output in bytes, KB, MB, or GB
-l show detailed low and high memory statistics
-o use old format (no -/+buffers/cache line)
-t display total for RAM + swap
-s update every [delay] seconds
-c update [count] times
-V display version information and exit
total | used | free | shared | buffers | cached | |
Mem: | 1992 | 785 | 1207 | 0 | 40 | 678 |
-/+ buffers/cache: | 65 | 1926 | ||||
Swap: | 0 | 2047 |
第一行:mem
used:指的是系统已使用的内存数
free:指的系统还没使用的内存数
shared:指的是被抛弃的内存数,始终为0
buffers:系统buffers使用的内存数
cached:系统cached的内存数(包括文件cache等)
第二行:
used: 为第一行的 used-buffers-cached
为应用程序实际使用的内存数
free:为第一行的 free+buffers+cached
为应用程序还可以使用的内存数
因为buffers和cached是系统为了提高性能申请的内存数,实际上当应用程序需要此功能时,是可以使用这些内存的,所以对应用程序来说,这些内存也是可以使用的.
第三行为swap的数
如果这里的used过大,就说明物理内存太少,应该加物理内存