Operations 14 min read

How to Interpret Linux /proc Memory Files for Troubleshooting

This guide explains how to read and analyze the most common /proc files that expose kernel memory statistics—such as zoneinfo, pagetypeinfo, meminfo, buddyinfo, slabinfo, vmstat, and related files—highlighting key fields and what they reveal about memory pressure, fragmentation, and possible leaks.

IT Services Circle
IT Services Circle
IT Services Circle
How to Interpret Linux /proc Memory Files for Troubleshooting

/proc/zoneinfo

# cat /proc/zoneinfo
Node 0, zone      DMA
 pages  free 808251
         min 1912
         low 2390
         high 2868
         scanned 0
         spanned 1015296
         present 1007616
         managed 917418
 nr_free_pages 808251
 nr_alloc_batch 69
 nr_inactive_anon 1878
 nr_active_anon 35777
 nr_inactive_file 36299
 nr_active_file 12876
 nr_unevictable 0
 nr_mlock 0
 nr_anon_pages 35598
 nr_mapped 29010
 nr_file_pages 51233
 nr_dirty 0
 nr_writeback 0
 nr_slab_reclaimable 8099
 nr_slab_unreclaimable 5837
 nr_page_table_pages 1105
 nr_kernel_stack 326
 nr_shmem 2059
 nr_dirtied 3391
 nr_written 3384
 nr_pages_scanned 0
 workingset_refault 0
 workingset_activate 0
 workingset_nodereclaim 0
 nr_anon_transparent_hugepages 0
 nr_free_cma 0
 protection: (0, 0, 0)
 pagesets
  cpu: 0 count: 33 high: 186 batch: 31 vm stats threshold: 36
  cpu: 1 count: 58 high: 186 batch: 31 vm stats threshold: 36
  cpu: 2 count: 93 high: 186 batch: 31 vm stats threshold: 36
  cpu: 3 count: 139 high: 186 batch: 31 vm stats threshold: 36
  cpu: 4 count: 185 high: 186 batch: 31 vm stats threshold: 36
 all_unreclaimable: 0
 start_pfn: 512
 inactive_ratio: 5

Important fields: pages free – available free pages. min / low / high – watermarks that trigger reclamation. present – total physical pages present. managed – pages managed by the kernel. nr_free_pages – same as pages free. nr_inactive_anon / nr_active_anon – inactive/active anonymous pages. nr_inactive_file / nr_active_file – inactive/active file‑backed pages. nr_slab_reclaimable / nr_slab_unreclaimable – reclaimable vs. unreclaimable slab memory. nr_shmem – shared memory pages. nr_dirty / nr_written – dirty and written pages.

Typical signs of trouble: pages free close to 0 → high memory pressure or leak.

Increasing nr_slab_unreclaimable → possible slab leak.

Very high nr_shmem → shared memory consuming excessive RAM, OOM risk.

Persistently high nr_dirty → I/O pressure.

Abnormal nr_file_pages / nr_anon_pages ratio → investigate file cache vs. private memory usage.

/proc/pagetypeinfo

# cat /proc/pagetypeinfo
Page block order: 9
Pages per block: 512
Free pages count per migrate type at order 0 1 2 3 4 5 6 7 8 9 10
Node 0, zone DMA, type Unmovable 18 10 2 0 1 1 1 0 1 1 1 0
Node 0, zone DMA, type Movable 0 1 0 0 0 0 1 1 1 0 0 0 832
Node 0, zone DMA, type Reclaimable 1 0 1 0 1 1 1 0 1 1 1 0
Number of blocks type Unmovable  Movable  Reclaimable  HighAtomic
Node 0, zone DMA 26 1924 18 0

Each block contains 512 pages (2⁹). The columns correspond to order 0 – 10 free block counts for each migration type. Unmovable – pages that cannot be moved. Movable – pages that can be relocated. Reclaimable – pages that the kernel can reclaim. HighAtomic – high‑atomic allocation pages.

If high‑order free blocks are scarce for Unmovable, the system suffers from memory fragmentation.

/proc/meminfo

# cat /proc/meminfo
MemTotal:        3669672 kB
MemFree:         3233664 kB
MemAvailable:    3432196 kB
Buffers:            10192 kB
Cached:            194796 kB
SwapCached:            0 kB
Active:            194344 kB
Inactive:          152704 kB
Active(anon):      142788 kB
Inactive(anon):      7508 kB
Active(file):        51556 kB
Inactive(file):     145196 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:            0 kB
SwapFree:             0 kB
Dirty:                 28 kB
Writeback:              0 kB
AnonPages:        142160 kB
Mapped:            116020 kB
Shmem:               8232 kB
Slab:               55688 kB
SReclaimable:       32372 kB
SUnreclaim:         23316 kB
KernelStack:          5216 kB
PageTables:           4400 kB
CommitLimit:     1834836 kB
Committed_AS:   1375504 kB
VmallocTotal: 258867136 kB
VmallocUsed:           0 kB
HugePages_Total:       0
HugePages_Free:        0
Hugepagesize:       2048 kB

Key fields used by free -m: MemTotal – total physical memory. MemFree – completely unused memory. MemAvailable – estimate of memory available for new processes (more accurate than MemFree). Buffers – block device buffers. Cached – file cache, reclaimable under pressure. SwapCached – pages swapped out then read back but not yet freed. Active / Inactive – active vs. inactive memory. Slab – total kernel slab memory (SReclaimable + SUnreclaim). CommitLimit – maximum memory the system can commit. Committed_AS – memory already committed; approaching CommitLimit raises OOM risk.

Typical checks:

Low MemFree and MemAvailable together indicate memory pressure.

Non‑zero SwapCached suggests insufficient RAM and frequent swapping.

Large Slab, especially a high SUnreclaim, may point to kernel object leaks. Committed_AS close to CommitLimit signals imminent OOM.

/proc/buddyinfo

# cat /proc/buddyinfo
Node 0, zone      DMA      28      9      9      6      1      3      1      1      2      2    787

Columns correspond to order 0 – 10 free block counts. A pattern of large numbers in early columns and small numbers later indicates serious fragmentation.

/proc/slabinfo

# cat /proc/slabinfo
slabinfo - version: 2.1
# name           <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> : tunables ...
 dentry          36017  36198   216   18   1 : tunables   0   0   0 : slabdata   2011   2011      0
 inode_cache     22152  22152   680   24   4 : tunables   0   0   0 : slabdata    923    923      0
 ext4_inode_cache 3425   3425   1296  25   8 : tunables   0   0   0 : slabdata    137    137      0
 ...

Each line shows: cache name, active objects, total objects, object size, objects per slab, pages per slab. When diagnosing slab leaks, monitor active_objs. If it keeps growing while the system is idle, the corresponding cache (e.g., dentry, inode_cache, kmalloc-*) is likely leaking.

/proc/vmallocinfo

0xffffff8008000000-0xffffff8008011000   69632 of_iomap+0x48/0x5c phys=fee00000 ioremap
0xffffff8008018000-0xffffff800801a000    8192 bpf_prog_alloc+0x48/0xb4 pages=1 vmalloc
0xffffffbdbff72000-0xffffffbdbfff0000  516096 pcpu_get_vm_areas+0x0/0x500 vmalloc

Format:

start‑end size allocation‑function physical‑address (if ioremap) allocation‑type

. Use this file to identify components that consume virtual memory via vmalloc or ioremap.

/proc/vmstat

nr_free_pages 807632
nr_alloc_batch 478
nr_inactive_anon 1876
nr_active_anon 35696
...
pgpgin 212188
pgpgout 17004
pswpin 0
pswpout 0
pgmajfault 1418
...

Global memory event counters. Relevant indicators: pswpin / pswpout non‑zero → physical memory insufficient, heavy swapping. pgmajfault high → many major page faults, sign of memory pressure. allocstall non‑zero → allocation stalls, indicating high pressure.

/proc/self/statm

927 111 95 7 0 108 0

Fields (pages, usually 4 KB):

1 – total virtual pages.

2 – resident set size (RSS).

3 – shared pages (shared libraries, etc.).

4 – code segment.

5 – data/heap.

6 – stack.

7 – swapped out pages.

/proc/self/maps

5578fe8000-5578fef000 r-xp 00000000 b3:07 181803 /bin/cat
558ad0e000-558ad2f000 rw-p 00000000 00:00 0 [heap]
7f9e147000-7f9e286000 r-xp 00000000 b3:07 91231 /lib/aarch64-linux-gnu/libc-2.27.so
7fee78b000-7fee7ac000 rw-p 00000000 00:00 0 [stack]
...

Each line format: start‑end permissions offset device:inode path. Permissions: r=read, w=write, x=execute, p=private, s=shared. When debugging memory layout, look for unusually large mappings or excessive anonymous mappings.

/proc/sys/vm

Adjustable kernel memory‑management parameters (common ones): dirty_ratio – percentage of memory that, when dirty pages exceed it, triggers write‑back. dirty_background_ratio – percentage at which background threads start flushing dirty pages. drop_caches – write 1/2/3 to free page cache / dentry cache / inode cache. min_free_kbytes – minimum amount of free memory the kernel tries to keep. swappiness – preference for swapping (0–100). overcommit_memory – 0=heuristic, 1=always allow, 2=prevent overallocation. vfs_cache_pressure – aggressiveness of VFS cache reclamation (higher = more aggressive).

/proc/swaps

Filename                Type      Size    Used   Priority
/dev/sda2               partition 8388604 0      -1

Check the Used column; values close to Size indicate severe physical memory pressure.

Reference: https://www.cnblogs.com/arnoldlu/p/8568330.html

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Memory ManagementKernelLinuxtroubleshootingprocfsvmstat
IT Services Circle
Written by

IT Services Circle

Delivering cutting-edge internet insights and practical learning resources. We're a passionate and principled IT media platform.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.