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

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

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

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

MemTotal:       16333852 kB

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

MemFree:         1633564 kB

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

Buffers:          212448 kB

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

Cached:          4422808 kB

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

SwapCached:            0 kB

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

Active:         10343096 kB

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

Inactive:        3784128 kB

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

Active(anon):    7954776 kB

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

Inactive(anon):  1537404 kB

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

Active(file):    2388320 kB

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

Unevictable:           0 kB

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:               0 kB

因为被用户程序锁住不能被回收的内存总量,单位是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)

([total RAM pages] - [total huge TLB pages]) * overcommit_ratio
───────────────────────────────────────────────────────────────── + [total swap pages]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 dividing Hugepagesize by the megabytes set aside for hugepages specified in /proc/sys/vm/hugetlb_poolThis 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

转载于:https://blog.51cto.com/john88wang/1827844

使用/proc/meminfo文件查看内存状态信息相关推荐

  1. 关于查看服务器状态信息的命令总结

    free -h 参数详解: total:内存总数 used:已经使用的内存总数 free:完全空闲的内存 shared:多个进程共享的内存 buff/cache:用于文件内容的缓冲 available ...

  2. /proc/cpuinfo_Linux中的/ proc / cpuinfo和/ proc / meminfo文件

    /proc/cpuinfo /proc is a directory in the Linux system that contains information about the system. / ...

  3. free :显示系统内存状态信息

    free :显示系统内存状态信息 Usage:free [options]Options:-b, --bytes show output in bytes-k, --kilo show output ...

  4. 【Linux 内核 内存管理】Linux 内核内存布局 ② ( x86_64 架构体系内存分布 | 查看 /proc/meminfo 文件 | /proc/meminfo 重要字段解析 )

    文章目录 一.查看 x86_64 架构体系内存分布 二./proc/meminfo 重要字段解析 一.查看 x86_64 架构体系内存分布 执行 cat /proc/meminfo 命令 , 可以查看 ...

  5. 根据/proc/meminfo对空闲内存进行占用

    #include <stdio.h>#include <sys/sysinfo.h> #include <linux/kernel.h> /* 包含sysinfo结 ...

  6. android meminfo,Android中dumpsys meminfo与/proc/meminfo获取空闲内存不一致的问题

    一.需求 获取当前系统中应用可用的空闲内存. 二.遇到的问题 方法一:dumpsys meminfo Total RAM: 3,498,412K (status normal) Free RAM: 1 ...

  7. Linux 命令之 netstat -- 查看网络状态信息/显示网络状态

    文章目录 命令介绍 常用选项 参考示例 (一)列出所有端口 (二)列出所有 TCP 端口 (三)列出所有 UDP 端口 (四)只显示监听端口 (五)只列出所有监听 tcp 端口 (六)只列出所有监听 ...

  8. 利用stat命令获取Linux文件系统和文件的详细状态信息

    用途:stat命令用于显示文件或文件系统的状态信息,来自于coreutils软件包,一般系统自带此命令工具,它能获取与文件系统及文件相关的许多信息,具体用途见stat的功能选项.这些信息包括inode ...

  9. 【小工具】- linux如何查看内存硬件信息(包含卡槽数量和每块内存条参数)

    环境信息 OS: CentOS Linux release 7.9.2009 (Core) dmidecode: 3.2 !!! dmidecode工具为系统自带. 工具介绍 dmidecode用于在 ...

最新文章

  1. 为什么U-Net在医学图像上表现优越?
  2. 极索(Gsuo)推出新版地图采用Gmap设计思路
  3. 安卓2.2系统上网设置
  4. Python2/3 list set性能测试
  5. 【Notes9】Linux系统启动过程,数据库,驱动,i2c-tools,shell
  6. defer 的前世今生
  7. php中时间轴,PHP时间轴函数
  8. Smart Form Tutorial(适用新手学习)
  9. java .jvp文件_GitHub - eddylapis/jvppeteer: Headless Chrome For Java (Java 爬虫)
  10. SQL SERVER LEFT JOIN, INNER JOIN, RIGHT JOIN
  11. h3c等价路由(rip)
  12. 阿里云原生专家洛浩:详解Serverless的起源、发展和落地实践
  13. 网络流行语“不作不死”英文入选美国词典
  14. AARRR模型——激活:获客红海背后的蓝海(上)
  15. 股市投资时,寻找低市盈率标的
  16. 常看的几个网站:推荐给大家
  17. 【Python】Matplotlib画图(七)——线的颜色、点的形状
  18. RabbitMQ 延迟队列和消息可靠传递
  19. Android 为摄像头增加闪光灯
  20. 给定一个单链表,把所有的奇数节点和偶数节点分别排在一起。 请注意,这里的奇数节点和偶数节点指的是节点编号的奇偶性,而不是节点的值的奇偶性。如下实例。示例 :输入: 1->2->3->4-

热门文章

  1. Linux内核设计与实现---进程地址空间
  2. PyCharm怎么关闭端口,解决端口占用问题
  3. c语言循环拆分成和,C语言拆分循环链表程序
  4. 数据结构练习——双向链表
  5. 数组名和取数组名的区别
  6. lambda 表达式定制操作
  7. java过滤器如何操作数据库_jsp – 使用Java中的过滤器验证用户名,密码(与数据库联系)...
  8. java实现矩阵相乘
  9. System.Configuration命名空间下的关键类
  10. XGBoost入门及实战