So I have a Linux kernel 4.14.73 system where I am using / proc / meminfo values in a program that shows the system specs including used memory and reserved memory. Everything was fine until I saw something really strange: the total memory committed is less than the memory used (or in the terms / proc / meminfo COMMITTED_AS <MEMTOTAL – MEMAVAILABLE). Here is the output from / proc / meminfo:
# cat /proc/meminfo MemTotal: 32911616 kB MemFree: 32322628 kB MemAvailable: 32360768 kB Buffers: 4604 kB Cached: 304088 kB SwapCached: 0 kB Active: 83876 kB Inactive: 263204 kB Active(anon): 46680 kB Inactive(anon): 152 kB Active(file): 37196 kB Inactive(file): 263052 kB Unevictable: 83788 kB Mlocked: 83788 kB SwapTotal: 0 kB SwapFree: 0 kB Dirty: 0 kB Writeback: 0 kB AnonPages: 122204 kB Mapped: 22348 kB Shmem: 1328 kB Slab: 52696 kB SReclaimable: 28548 kB SUnreclaim: 24148 kB KernelStack: 2896 kB PageTables: 2348 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 32911616 kB Committed_AS: 366544 kB VmallocTotal: 34359738367 VmallocUsed: 0 kB VmallocChunk: 0 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB DirectMap4k: 47004 kB DirectMap2M: 4050944 kB DirectMap1G: 29360128 kB
This gives me ~ 538 MB of used memory but only ~ 358 MB of committed memory! How is it possible that the total memory allocated in the system is less than the memory used? Or can someone point out if I am doing something wrong here?
Please any suggestions on what is happening here would be highly appreciated!