memory utilization questions
Hello,
I am trying to measure memory available for "malloc" in my application.
From /proc/meminfo I have the following:
MemTotal: 1035372 kB
MemFree: 117488 kB
Buffers: 79140 kB
Cached: 499216 kB
SwapCached: 0 kB
Active: 511768 kB
Inactive: 360340 kB
HighTotal: 130744 kB
HighFree: 252 kB
LowTotal: 904628 kB
LowFree: 117236 kB
SwapTotal: 2048276 kB
SwapFree: 2048276 kB
Dirty: 96 kB
Writeback: 0 kB
Mapped: 388224 kB
Slab: 30412 kB
CommitLimit: 2565960 kB
Committed_AS: 636504 kB
PageTables: 3160 kB
VmallocTotal: 106488 kB
VmallocUsed: 3676 kB
VmallocChunk: 102336 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 4096 kB
I have very similar result from the "sysconf", however RedHat System Monitor reports used memory as 360M off ~1G, so they report "Inactive" memory as free...
Which one I should use as a limit for "mallocs" in my process, so that it
wouldn't "overrun" the system? E.g. does "malloc" allocate from "Vmalloc total", or from "Inactive"?
Thanks,
-V
|