Interpretation
Wednesday
-
Red Hat Enterprise Linux (RHEL) 5
-
Red Hat Enterprise Linux (RHEL) 6
-
Red Hat Enterprise Linux (RHEL) 7
-
Red Hat Enterprise Linux (RHEL) 8
Question
I need an interpretation of the output /proc/meminfo
…
I want to compare the output free -k
with cat /proc/meminfo
…
Solution
Output comparison
total used free shared buffers cached
Mem: 7778104 2971960 4806144 0 211756 1071092
-/+ buffers/cache: 1689112 6088992
Swap: 4194296 0 4194296
total used free shared buff/cache available
Mem: 1012952 252740 158732 11108 601480 543584
Swap: 1048572 5380 1043192
MemTotal: 7778104 kB
MemFree: 4806144 kB
Buffers: 211756 kB
Cached: 1071092 kB
SwapTotal: 4194296 kB
SwapFree: 4194296 kB
MemAvailable: 543584 kB
Output mapping free -k
with /proc/meminfo
The following table shows how to get the output free
mapped to fields /proc/meminfo
on Red Hat Enterprise Linux 5, 6, and 7/8.
output free |
corresponding fields / proc / meminfo |
Mem: total |
MemTotal |
Mem: used |
MemTotal – MemFree |
Mem: free |
MemFree |
Mem: shared (can be ignored for the time being, it doesn’t make any difference). |
N / A (not available) |
Mem: buffers |
Buffers |
Mem: cached |
Cached |
– / + buffers / cache: used |
MemTotal – (MemFree + Buffers + Cached) |
– / + buffers / cache: free |
MemFree + Buffers + Cached |
Swap: total |
SwapTotal |
Swap: used |
SwapTotal – SwapFree |
Swap: free |
SwapFree |
The following table shows how to get the output free
corresponding to the fields /proc/meminfo
on Red Hat Enterprise Linux 7.1 or later (procps-ng 3.3.10).
output free |
corresponding fields / proc / meminfo |
Mem: total |
MemTotal |
Mem: used |
MemTotal – MemFree – Buffers – Cached – Slab |
Mem: free |
MemFree |
Mem: shared |
Shmem |
Mem: buff / cache |
Buffers + Cached + Slab |
Mem: available |
MemAvailable |
Swap: total |
SwapTotal |
Swap: used |
SwapTotal – SwapFree |
Swap: free |
SwapFree |
Root cause
Diagnostic steps
Most of the material is taken from the kernel documentation (Documentation/filesystems/proc.txt
and Documentation/vm/hugetlbpage.txt
)
High level statistics
RHEL 5, RHEL 6 and RHEL 7/8
-
MemTotal: Total used memory
-
MemFree: The amount of physical memory not used by the system
-
Buffers: Memory in the buffer cache, that is, relatively temporary storage for unprocessed disk blocks. It doesn’t have to be very big.
-
Cached: Memory in page cache (pagecache) (disk cache and shared memory).
-
SwapCached: Memory that is present inside the main and also in the paging file. (If memory becomes necessary, this area does not need to be swapped out AGAIN because it is already in the paging file. This saves I / O and improves performance if the machine runs out of memory.)
RHEL 7 only
-
MemAvailable: An estimate of how much memory is available to run new applications without swapping.
Detailed level statistics
RHEL 5, RHEL 6 and RHEL 7/8
-
Active: Memory that has been used recently and is usually not swapped out or freed
-
Inactive: Memory that not has been used recently and can be unloaded or released.
For RHEL 6 and RHEL 7/8 only
-
Active (anon): Anonymous memory that has been used recently and is not usually swapped out.
-
Inactive (anon): Anonymous memory that has not been used recently and can be swapped out.
-
Active (file): Pagecache memory that has been used recently and is usually not freed until needed.
-
Inactive (file): Pagecache memory that can be reclaimed without significantly impacting performance
-
Unevictable: Unrecoverable pages cannot be unloaded for a number of reasons.
-
Mlocked: Pages locked in memory using a system call
mlock()
… Blocked pages are also Unrecoverable.
Memory statistics
RHEL 5, RHEL 6 and RHEL 7/8
-
SwapTotal: Total available swap space.
-
SwapFree: Remaining available swap space.
-
Dirty: Memory waiting to be written to disk
-
Writeback: Memory that is actively being written to disk
-
AnonPages: Non-file supported pages mapped to user-space page tables
-
Mapped: Files that have been displayed, such as libraries.
-
Slab: Cache of data structures inside the kernel
-
PageTables: The amount of memory reserved for the lowest level of the page tables. This parameter can grow to a high value if many processes are attached to the same shared memory segment.
-
NFS_Unstable: NFS pages sent to the server but not yet committed to storage.
-
Bounce: Memory used for
bounce buffers
block devices -
CommitLimit: Based on the memory over-allocation ratio (
vm.overcommit_ratio
), this is the total amount of memory that can currently be allocated on the system. This limit is respected only if strict overcommit accounting is enabled (mode 2 in vm.overcommit_memory). -
Committed_AS: The amount of memory currently allocated on the system. Committed memory is the sum of all memory that has been committed by processes, even if it has not yet been “used” by them.
-
VmallocTotal: total size of the memory area
vmalloc
… -
VmallocUsed: area volume
vmalloc
which is used -
VmallocChunk: the largest contiguous block of an area
vmalloc
which is free -
HugePages_Total: number of huge pages allocated by the kernel (Determined by
vm.nr_hugepages
) -
HugePages_Free: The number of huge pages not allocated by the process.
-
HugePages_Rsvd: The number of huge pages that have been committed to provisioning from the standby pool but have not yet been provisioned.
-
Hugepagesize: The size
hugepage
(typically 2 MB on an Intel based system).
For RHEL 6 and RHEL 7/8 only
-
Shmem: Total used shared memory (shared by multiple processes including RAM disks, SYS-V-IPC, and BSDs like SHMEM)
-
SReclaimable: The part of the Slab that can be released (for example, the cache).
-
SUnreclaim: the part of the Slab that cannot be released under the pressure of memory.
-
KernelStack: Memory used by the kernel stack. It cannot be released.
-
WritebackTmp: Memory used by FUSE for temporary write-back buffers.
-
HardwareCorrupted: The amount of RAM that the kernel has identified as damaged / non-working.
-
AnonHugePages: Non-file huge pages mapped to user space page tables.
-
HugePages_Surp: Number of huge pages in the pool exceeding the value in
vm.nr_hugepages
… The maximum number of extra huge pages is controlledvm.nr_overcommit_hugepages
… -
DirectMap4k: The amount of memory used to display standard 4k pages.
-
DirectMap2M: amount of memory used for display
hugepages
(usually 2 MB in size). -
DirectMap1G… Memory used for display
hugepages
(usually 1 GB in size).
Note for DirectMap1G: This value will be available in /proc/meminfo
only if the appropriate processor hardware supports it. You can verify this by checking for the ‘pdpe1gb’ flag in /proc/cpuinfo
…
This research is part of Red Hat’s Fast Track Publishing Program, which provides a huge library of solutions that Red Hat engineers have produced in support of our customers. To provide you with the knowledge you need as soon as it becomes available, these articles may be presented in raw and unedited form.
The material was prepared within the framework of the specialization Administrator Linux.
We invite everyone to the open lesson “Proxmox VE: setting up a home virtualization server“. In the lesson we:
– we will discuss the existing virtualization tools;
– Let’s compare ProxmoxVE with other hypervisors;
– install, configure and work in ProxmoxVE.
>> REGISTRATION