/proc/meminfo explained

I recently had a question about Linux that created more questions the longer I thought about it. The question was: "Given the app doesn't care, would you recommend 32 bit or 64 bit Oracle Linux for a server?"
Driver compatibility plays a part, as does the amount of RAM the app needs. If you need more than 4 GB of RAM, you'll have to use a 64bit kernel... or do you...?

I'm still not absolutely sure about it as information is a bit ambiguous. While some say you cannot allocate more than 3.7 GB of RAM to any one process on a 32 bit machine, using PAE,
others say to just check free -m or vmstat. Red Hat lists /proc/meminfo as a good source of information and explains what you see there. All said and done, I still don't know for sure.

I have a VM with 4 cores and 8 GB of RAM, and it says:

[root@server ~]# uname -a
Linux server 2.6.9- #1 SMP Wed May 2 14:59:56 PDT 2007 i686 i686 i386 GNU/Linux
[root@server ~]# cat /proc/meminfo
MemTotal: 8054844 kB
MemFree: 6638196 kB
Buffers: 248500 kB
Cached: 363020 kB
SwapCached: 0 kB
Active: 1037180 kB
Inactive: 167692 kB
HighTotal: 7208896 kB
HighFree: 6241920 kB
LowTotal: 845948 kB
LowFree: 396276 kB
SwapTotal: 2097144 kB
SwapFree: 2097144 kB
Dirty: 796 kB
Writeback: 0 kB
Mapped: 676496 kB
Slab: 188576 kB
CommitLimit: 6124564 kB
Committed_AS: 1886648 kB
PageTables: 6192 kB
VmallocTotal: 106488 kB
VmallocUsed: 3784 kB
VmallocChunk: 102324 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 2048 kB

So it sees 8 GB, has 6 GB free, the application uses 245 MB and about 1 GB of RAM is marked as active. Another VM has similar numbers.
Using the 'free' command I get:

[cpeper@l0292 ~]$ free -m
total used free shared buffers cached
Mem: 7866 1382 6483 0 242 354
-/+ buffers/cache: 785 7081
Swap: 2047 0 2047

So 7.8 GB free (difference due to 1024 bytes per KB vs 1000 bytes per KB and some kernel and buffer usage either subtracted or not). 1.3 GB used and the application uses 785 MB.

I simply can't find one server that really approaches the RAM limit... yet... Guess I'll try to use the Java VM test. Incidentally, Red Hat and Oracle Linux version 5 and higher support PAE.

No comments: