700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 使用/proc/meminfo文件查看内存状态信息

使用/proc/meminfo文件查看内存状态信息

时间:2023-06-25 17:53:11

相关推荐

使用/proc/meminfo文件查看内存状态信息

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

#cat/proc/meminfoMemTotal:16333852kBMemFree:1633564kBBuffers:212448kBCached:4422808kBSwapCached:0kBActive:10343096kBInactive:3784128kBActive(anon):7954776kBInactive(anon):1537404kBActive(file):2388320kBInactive(file):2246724kBUnevictable:0kBMlocked:0kBSwapTotal:2047992kBSwapFree:2047992kBDirty:672kBWriteback:0kBAnonPages:9491968kBMapped:34240kBShmem:212kBSlab:375180kBSReclaimable:316296kBSUnreclaim:58884kBKernelStack:27456kBPageTables:35396kBNFS_Unstable:0kBBounce:0kBWritebackTmp:0kBCommitLimit:10214916kBCommitted_AS:19743752kBVmallocTotal:34359738367kBVmallocUsed:303556kBVmallocChunk:3435940kBHardwareCorrupted:0kBAnonHugePages:0kBHugePages_Total:0HugePages_Free:0HugePages_Rsvd:0HugePages_Surp:0Hugepagesize:2048kBDirectMap4k:10240kBDirectMap2M: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.

参考文档:

/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s2-proc-meminfo.html

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。