linux ram size

C++
$ cat /proc/meminfofree -m
Source

Also in C++: