How to know your RAM on linux machine?

You can know the RAM on your linux machine using the command: cat /proc/meminfo

This would give the following output:

MemTotal: 262312 kB
MemFree: 201452 kB
Buffers: 4568 kB
Cached: 24740 kB
SwapCached: 0 kB
Active: 29072 kB
Inactive: 14924 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 262312 kB
LowFree: 201452 kB
SwapTotal: 524280 kB
SwapFree: 524280 kB
Dirty: 20 kB
Writeback: 0 kB
Mapped: 22412 kB
Slab: 7584 kB
CommitLimit: 655436 kB
Committed_AS: 45288 kB
PageTables: 700 kB
VmallocTotal: 593912 kB
VmallocUsed: 384 kB
VmallocChunk: 593528 kB

What does this mean?

All files on linux are stored as files. In /proc, we find virutal files, and hence /proc is also called virtual file system. Mostly, the size of the files is 0 and they are read when read using cat to give some information.

MemTotal: Total usable ram (i.e. physical ram)

MemFree: Is sum of LowFree+HighFree (overall stat)Cached: Memory in the pagecache (diskcache) minus SwapCache

SwapCache: Memory that once was swapped out, is swapped back in but still also is in the swapfile (if memory is needed it doesn’t need to be swapped out AGAIN because it is already in the swapfile. This saves I/O)