/proc/meminfo is one of the more commonly used files in the /proc/, as it reports a large amount of valuable information about the Linux system's memory. Here is the brief description of what each value stands for
- MemTotal: Total usable RAM in kilobytes (i.e. physical memory minus a few reserved bytes and the kernel binary code)
- MemFree: The amount of physical RAM left unused by the system.
- Buffers: The amount of physical RAM used for file buffers.
- Cached: The amount of physical RAM used as cache memory. Memory in the pagecache (diskcache) minus SwapCache.
- SwapCache: This is the amount of Swap used as cache memory. Memory that once was swapped out, is swapped back in, but is still in the swapfile.
- Active: The total amount of buffer or page cache memory, that is active. This part of the memory is used recently and usually not reclaimed unless absolutely necessary.
- Inactive: The total amount of buffer or page cache memory that are free and available. This is memory that has not been recently used and can be reclaimed for other purposes by the paging algorithm.
- HighTotal: is the total amount of memory in the high region. The HighTotal value can vary based on the type of kernel used. Kernel uses indirect tricks to access the high memory region. Data cache can go in this memory region.
- LowTotal: The total amount of non-highmem memory.
- LowFree: The amount of free memory of the low memory region. This is the memory the kernel can address directly. All kernel datastructures need to go into low memory
- SwapTotal: Total amount of physical swap memory.
- SwapFree: Total amount of swap memory free.
- Dirty: The total amount of memory waiting to be written back to the disk.
- Writeback: The total amount of memory actively being written back to the disk.
- Committed_AS: An estimate of how much RAM you would need to make a 99.99% guarantee that there never is OOM (out of memory) for this workload. Normally the kernel will overcommit memory. This parameter represents the worst case scenario value, and also includes swap memory.
Sample /proc/meminfo output:
[root@unixfoo ~]# cat /proc/meminfo
MemTotal: 8306228 kB
MemFree: 6073032 kB
Buffers: 90452 kB
Cached: 1611508 kB
SwapCached: 0 kB
Active: 708732 kB
Inactive: 1343944 kB
HighTotal: 5242872 kB
HighFree: 4641792 kB
LowTotal: 3063356 kB
LowFree: 1431240 kB
SwapTotal: 25165812 kB
SwapFree: 25165604 kB
Dirty: 416 kB
Writeback: 0 kB
Mapped: 414608 kB
Slab: 119916 kB
CommitLimit: 29318924 kB
Committed_AS: 1489284 kB
PageTables: 26120 kB
VmallocTotal: 106488 kB
VmallocUsed: 15388 kB
VmallocChunk: 90752 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 2048 kB
[root@unixfoo ~]#
vmstat : The performance monitoring command "vmstat" also gives lot of good information about the system memory. With "-s" option, vmstat displays a table of various event counters and memory statistics.
[root@unixfoo ~]# vmstat -s
8306228 total memory
2225116 used memory
713752 active memory
1330888 inactive memory
6081112 free memory
90452 buffer memory
1599548 swap cache
25165812 total swap
208 used swap
25165604 free swap
7398125 non-nice user cpu ticks
212310 nice user cpu ticks
7286524 system cpu ticks
2218605623 idle cpu ticks
2459153 IO-wait cpu ticks
253230 IRQ cpu ticks
0 softirq cpu ticks
65736670 pages paged in
112371810 pages paged out
0 pages swapped in
52 pages swapped out
3591866239 interrupts
1678911991 CPU context switches
1232778766 boot time
11535515 forks
[root@unixfoo ~]#