linux查看当前内存情况,Linux命令行查看当前内存使用情况 - free

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值