Score:0

/proc/meminfo shows MemFree greater than MemAvailable - Does it make sense?

in flag

From what I could understand from this change in Linux reported memory usage, /proc/meminfo reports MemFree as currently unused RAM, and MemAvailable as RAM currently available to new processes without swapping.

From this, shouldn't MemFree be contained in MemAvailable, thus being always less or equal than it? I guess unused RAM is also available to new processes without swapping. Or am I misunderstanding the "Free memory cannot be taken below the low watermark" (4th chunk from patch) part?

These values match, as expected, free and top outputs.

I saw this in an Exadata virtual machine with these specs:

cat /etc/oracle-release 
Oracle Linux Server release 7.8

uname -r
4.14.35-1902.306.2.1.el7uek.x86_64

rpm -q sysstat
sysstat-10.1.5-19.el7.x86_64

Full /proc/meminfo at an arbitrary moment, if it helps:

MemTotal:       19995464 kB
MemFree:         2963684 kB
MemAvailable:    1063344 kB
Buffers:          406124 kB
Cached:          2609256 kB
SwapCached:         9648 kB
Active:          4632640 kB
Inactive:        2348256 kB
Active(anon):    3882372 kB
Inactive(anon):   700524 kB
Active(file):     750268 kB
Inactive(file):  1647732 kB
Unevictable:      634040 kB
Mlocked:          634044 kB
SwapTotal:      16777212 kB
SwapFree:       16579068 kB
Dirty:              1684 kB
Writeback:             0 kB
AnonPages:       4592704 kB
Mapped:           384108 kB
Shmem:            484212 kB
Slab:             511064 kB
SReclaimable:     249660 kB
SUnreclaim:       261404 kB
KernelStack:       23184 kB
PageTables:        96648 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    24602016 kB
Committed_AS:    5737344 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
CmaTotal:              0 kB
CmaFree:               0 kB
HugePages_Total:    2122
HugePages_Free:      590
HugePages_Rsvd:        1
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:      833536 kB
DirectMap2M:    15943680 kB
DirectMap1G:     5242880 kB

Thanks,
Emerson

jp flag
The formula for MemAvailable is in the code you linked to.
in flag
@AlexD Yes. The problem is my understanding - from that formula, is it possible to have more available RAM than free RAM?
jp flag
`available = i.freeram - wmark_low`. It means that the value initially assigned to `MemAvailable` is `(MemFree - low watermark)` which is less than `MemFree`.
in flag
@AlexD Makes sense. The low watermark can be greater than the other components of MemAvailable. I really thought it was impossible, but maybe it's a normal edge case. I guess that's it. Would you repost that as an answer?
Score:1
jp flag

The code starts as available = i.freeram - wmark_low.

It means that the value initially assigned to MemAvailable is (MemFree - low watermark) which is less than MemFree.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.