在Linux下可以使用/proc/meminfo文件查看操作系统内存的使用状态

#cat/proc/meminfoMemTotal:16333852kB
MemFree:1633564kB
Buffers:212448kB
Cached:4422808kB
SwapCached:0kB
Active:10343096kB
Inactive:3784128kB
Active(anon):7954776kB
Inactive(anon):1537404kB
Active(file):2388320kB
Inactive(file):2246724kB
Unevictable:0kB
Mlocked:0kB
SwapTotal:2047992kB
SwapFree:2047992kB
Dirty:672kB
Writeback:0kB
AnonPages:9491968kB
Mapped:34240kB
Shmem:212kB
Slab:375180kB
SReclaimable:316296kB
SUnreclaim:58884kB
KernelStack:27456kB
PageTables:35396kB
NFS_Unstable:0kB
Bounce:0kB
WritebackTmp:0kB
CommitLimit:10214916kB
Committed_AS:19743752kB
VmallocTotal:34359738367kB
VmallocUsed:303556kB
VmallocChunk:34359420140kB
HardwareCorrupted:0kB
AnonHugePages:0kB
HugePages_Total:0
HugePages_Free:0
HugePages_Rsvd:0
HugePages_Surp:0
Hugepagesize:2048kB
DirectMap4k:10240kB
DirectMap2M:16766976kB



注意这个文件显示的单位是kB而不是KB,1kB=1000B,但是实际上应该是KB,1KB=1024B

这个显示是不精确的,是一个已知的没有被更正的历史遗留问题。因为很多程序依赖这个文件查看内存使用的是kB字符


MemTotal:16333852kB


MemTotal是可使用内存的总量,单位是KB,物理内存减去一些保留内存和内核二进制代码占用的内存


MemFree:1633564kB


MemFree 剩下没有被使用的物理内存,单位是kibibytes,即KB


Buffers:212448kB

Buffers 临时存储原始磁盘块的总量,单位是KB


Cached:4422808kB


Cached 用作缓存内存的物理内存总量,单位是KB



SwapCached:0kB


SwapCached 曾经被移入到swap,然后又回到主内存,但是仍然也在swapfile中保留的总内存大小。这样可以节省I/O,应为内存不需要再移入到swap


Active:10343096kB

Active 最近经常被使用的内存大小总量,单位是KB。


Inactive:3784128kB


Inactive 最近不是经常使用的内存,单位是KB


Active(anon):7954776kB

匿名和tmpfs/shmem内存总量,单位是KB. 自上次系统移动一些什么东西到swap后处于活动使用状态或者之前处于活动使用状态的内存


Inactive(anon):1537404kB

作为候选收回的匿名和tmpfs/shmen内存总量,单位是KB


Active(file):2388320kB

文件缓存内存的总量,单位是KB。处于活动使用状态,或者之前自上次系统召回内存处于活动使用状态的内存

Unevictable:0kB

The amount of memeory,in kibibytes,discovered by the pageout code,that is not evictable because it is locked into memeory by user programs.


Mlocked:0kB

因为被用户程序锁住不能被回收的内存总量,单位是KB


SwapTotal:

swap总量,单位是KB


SwapFree:

空闲swap总量

Dirty 等待写回到磁盘内存总量,单位是KB


Writeback 正在写回到磁盘的内存总量,单位是KB


AnonPages The total amount of memory,in kibibytes,used by pages that are not backed by files and are mapped into userspace page tables


Mapped The memory,in kibibytes, used for files that have been mmaped,such as libraries


Shmem The total amount of memeory,in kibibytes,used by shared memeory(shmem) and tmpfs


Slab The total amount of memeory,in kibibytes,used by the kernel to cache data structures for its own use.



SReclaimable The part of Slab that can be reclaimed,such as caches.



SUnreclaim The part of Slab that cannot be reclaimed even when lacking memeory


KernelStack The amount of memeory,in kibibytes,used by the kernel stack allocations done for each task in the system


PageTables The total amount of memeory,in kibibytes,dedicated to the lowest page table level.



NFS_Unstable The amount,in kibibytes,of NFS page sent to the server but not yet committed to the stable storage


Bounce The amount of memory,in kibibytes,used for the block device "bounce buffers"


WritebackTmp The amount of memory,in kibibytes, used by FUSE for temporary writeback buffers


CommitLimit The total amount of memory currently avaiable to be allocated on the system based on the overcommit ratio(vm.overcommit_ratio) This limit is only adhered of if stric overcommit accounting is enabled(mode 2 in vm.overcommit_memory)


([totalRAMpages]-[totalhugeTLBpages])*overcommit_ratio─────────────────────────────────────────────────────────────────+[totalswappages]100

例如1G的物理内存和7GB的swap内存,vm.overcommit_ratio设置为30,那么CommitLimit 就是7.3GB


Committed_AS The total amount of memory,in kibibytes,estimated to complete the workload.

This value repsents the worst case scenario value,and also includes swap memory


VMallocTotal The total amount of memory,in kibibytes,of total allocated virtual address space


VMallocUsed― The total amount of memory, in kibibytes, of used virtual address space.


VMallocChunk― The largest contiguous block of memory, in kibibytes, of available virtual address space.


HardwareCorrupted― The amount of memory, in kibibytes, with physical memory corruption problems, identified by the hardware and set aside by the kernel so it does not get used.


AnonHugePages― The total amount of memory, in kibibytes, used by huge pages that are not backed by files and are mapped into userspace page tables.


HugePages_Total― The total number of hugepages for the system. The number is derived by dividingHugepagesizeby the megabytes set aside for hugepages specified in/proc/sys/vm/hugetlb_pool.This statistic only appears on the x86, Itanium, and AMD64 architectures.


HugePages_Free― The total number of hugepages available for the system.This statistic only appears on the x86, Itanium, and AMD64 architectures.


HugePages_Rsvd― The number of unused huge pages reserved for hugetlbfs.

HugePages_Surp― The number of surplus huge pages.


Hugepagesize― The size for each hugepages unit in kibibytes. By default, the value is 4096 KB on uniprocessor kernels for 32 bit architectures. For SMP, hugemem kernels, and AMD64, the default is 2048 KB. For Itanium architectures, the default is 262144 KB.This statistic only appears on the x86, Itanium, and AMD64 architectures.


DirectMap4k― The amount of memory, in kibibytes, mapped into kernel address space with 4 kB page mappings.


DirectMap2M― The amount of memory, in kibibytes, mapped into kernel address space with 2 MB page mappings.











参考文档:

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s2-proc-meminfo.html



本文出自 “Linux SA John” 博客,请务必保留此出处http://john88wang.blog.51cto.com/2165294/1827844

更多相关文章

  1. arm-linux学习笔记3-linux内存管理与文件操作
  2. CENTOS 修改MYSQL文件到内存盘
  3. Linux进程间通信—— 内存映射
  4. 获取Linux 内存页大小的命令
  5. Linux 内存寻址之分段机制
  6. jmap使用以及 linux下查看进程的内存使用情况
  7. Zabbix - LINUX下CPU,硬盘,流量,内存监控
  8. Linux内存管理 - PAGE_OFFSET理解
  9. Linux内存占用分析 进程内存空间

随机推荐

  1. android XMl 解析神奇xstream 四: 将复杂
  2. Qt for Android 调用android原生接口分享
  3. Android 9 (P)系统启动之SystemServer大
  4. Android开发经验总结——ListView的使用
  5. 解决Android(安卓)Toobar与状态栏重叠
  6. Android的ListView控件滚动时背景问题
  7. Android 应用程序(APK) 如何获得系统签名
  8. libacc : Android 2.0 內建的輕量級 C Co
  9. Android学习及如何利用android来赚钱
  10. Android关于ViewPager+Fragment缓存问题