Learn through the super-clean Baeldung Pro experience:
>> Membership and Baeldung Pro.
No ads, dark-mode and 6 months free of IntelliJ Idea Ultimate to start with.
Last updated: November 17, 2025
The /proc/meminfo file inside the /proc pseudo-filesystem provides a usage report about memory on the system. When we want to find out statistics like used and available memory, swap space, or cache and buffers, we can analyze this file’s contents. However, there are tons more data on top of the basic information.
In this article, we’re going to examine every data field in the /proc/meminfo file.
To see what a file contains, we can use the cat command:
$ cat /proc/meminfo
MemTotal: 994548 kB
MemFree: 65228 kB
MemAvailable: 263724 kB
Buffers: 21396 kB
Cached: 304440 kB
SwapCached: 25260 kB
Active: 267424 kB
Inactive: 503720 kB
Active(anon): 110956 kB
Inactive(anon): 351176 kB
...
As we can see above, the /proc/meminfo file contains memory statistics in kilobytes. Now, let’s take a look at each of them by category.
Usually, we only need basic information about memory, such as how much RAM our system has or how much is available at the current moment:
$ cat /proc/meminfo | grep "Mem"
MemTotal: 994328 kB
MemFree: 66428 kB
MemAvailable: 207192 kB
Basically, we get a simple memory snapshot:
However, these basic values are available in other tools as well.
Sometimes, we may want to check buffer and cache sizes. Specifically, buffers are temporary storage components for process input and output. They don’t increase the processing speed. On the other hand, cache stores some data to serve future requests faster. As a result, the cache increases the processing speed.
Of course, we can access the memory size information for both:
$ cat /proc/meminfo | grep -e "Buffers" -we "Cached"
Buffers: 12820 kB
Cached: 254592 kB
Let’s define these two attributes:
Indeed, distinguishing different caching levels enables better memory management in terms of hierarchy.
Furthermore, we can learn all about the swap space on the system:
$ cat /proc/meminfo | grep "Swap"
SwapCached: 13936 kB
SwapTotal: 945416 kB
SwapFree: 851064 kB
Basically, swap space is a backup space on the disk for RAM. When the physical memory is full, the system uses the swap space:
Importantly, the /proc/swap file lists the different available swap areas.
Moreover, the /proc/meminfo file also contains data about memory dynamics:
$ cat /proc/meminfo | grep -e "Active" -e "Inactive"
Active: 194308 kB
Inactive: 553172 kB
Active(anon): 59024 kB
Inactive(anon): 437264 kB
Active(file): 135284 kB
Inactive(file): 115908 kB
In this case, there are two categories: file or non-file (anon). Here, we are interested in the general result:
Knowing the breakdown of active and inactive memory enables better handling of memory-intensive applications such as servers.
Moreover, we’re able to get information about the amount of memory that’s being or is about to be written back:
$ cat /proc/meminfo | grep -e "Dirty" -e "Writeback"
Dirty: 0 kB
Writeback: 0 kB
WritebackTmp: 0 kB
Following is a summary of the fields:
Of course, operations are much slower when they involve secondary memory. Because of this, monitoring how much data is pending enables an administrator to properly balance loads.
In addition, we can look at how much memory is mapped. Essentially, memory-mapped files are part of the virtual memory system, which contains a direct byte-level correlation with other resources. Memory mapping increases the maximum number of I/O operations, especially on large files:
$ cat /proc/meminfo | grep -w -e "AnonPages" -e "Mapped" -e "DirectMap4k" -e "DirectMap2M"
AnonPages: 470224 kB
Mapped: 144264 kB
DirectMap4k: 149440 kB
DirectMap2M: 899072 kB
To be sure, these mappings provide the following information:
While memory mapping has its benefits, it also blocks parts of the main memory from being used for actual data.
Moreover, we can learn about the shared memory in the system. Shared memory is an additional memory location for processes with separate address spaces. Such processes can share a portion of memory:
$ cat /proc/meminfo | grep "Shmem"
Shmem: 16520 kB
ShmemHugePages: 0 kB
ShmemPmdMapped: 0 kB
There are several ways to represent the shared memory:
While convenient, shared memory presents challenges that may make it problematic.
The Linux kernel has lots of inner low-level operations to take care of memory. Fortunately, the /proc/meminfo file provides several kernel-level pieces of information as well:
$ cat /proc/meminfo | grep -ie "reclaim" -e "slab" -e "kernel"
KReclaimable: 35008 kB
Slab: 88752 kB
SReclaimable: 35008 kB
SUnreclaim: 53744 kB
KernelStack: 5988 kB
In fact, the kernel uses memory in different ways:
For example, the kernel memory holds all open file descriptors. Running out of kernel memory can cause the forceful termination of processes.
If we want to learn the amount of memory eligible for allocation or already allocated on the system, we can take a look at two data fields:
$ cat /proc/meminfo | grep -ie "commit"
CommitLimit: 1442580 kB
Committed_AS: 3035924 kB
Markedly, these data points demonstrate the allocation ability of the system:
Note the difference between Committed_AS and the Inactive field we already saw. In fact, there’s a formula for calculating the current allocatable amount of memory.
Besides, /proc/meminfo contains some data about the virtual memory system:
$ cat /proc/meminfo | grep -e "PageTables" -e "Vmalloc"
PageTables: 11520 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 34780 kB
VmallocChunk: 0 kB
Using the output above, let’s define the meaning of each field:
Critically, these fields differ from the information about swap, as there is a difference between swap and virtual memory.
Since the Linux kernel supports huge (larger than the default) pages, we can see data about them as well:
$ cat /proc/meminfo | grep -ie "huge" -e "filepmd" | grep -v "Shmem"
AnonHugePages: 0 kB
FileHugePages: 0 kB
FilePmdMapped: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 0 kB
Obviously, we get lots of information to look at:
Generally, systems that process data in larger chunks can benefit greatly from huge pages. In such cases, controlling and monitoring the current huge page settings is crucial.
Finally, we can also get some miscellaneous information along the rest of the categories:
$ cat /proc/meminfo | grep -e "Unevictable" -e "Mlocked" -e "NFS" -e "Bounce" -e "Percpu" -e "Hardware"
Unevictable: 0 kB
Mlocked: 0 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
Percpu: 1312 kB
HardwareCorrupted: 0 kB
Each field in this set refers to a distinct attribute of memory:
Of these, HardwareCorrupted is usually very helpful, as it points out potential issues with memory, affecting all other discussed fields.
In this article, we learned about the structure of data inside /proc/meminfo. In fact, we saw that this file contains most of the information we might need about memory. We then inspected every piece of data by splitting them into categories.