Howto check RAM on Linux

December 6, 2008 by admin · Comments 

Sometimes  you want to know how much memory you have on a Linux box.  There are several ways to do this but I have found the best and easiest way is to us the top process.

At the command line enter type top or vmstat.

Example:

[root@ftp ~]#top

top – 15:49:46 up 53 days, 11:54,  1 user,  load average: 0.00, 0.00, 0.00
Tasks:  71 total,   1 running,  70 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.3%us,  0.0%sy,  0.0%ni, 99.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1034796k total,   985256k used,    49540k free,   144156k buffers
Swap:  2031608k total,        0k used,  2031608k free,   778420k cached

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
1 root      15   0  2060  620  532 S  0.0  0.1   0:00.61 init
2 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 migration/0
3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/0
5 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 events/0
6 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khelper
7 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kthread
10 root      20  -5     0    0    0 S  0.0  0.0   0:00.22 kblockd/0
11 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 kacpid
73 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 cqueue/0
76 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khubd
78 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kseriod
138 root      25   0     0    0    0 S  0.0  0.0   0:00.00 pdflush
139 root      15   0     0    0    0 S  0.0  0.0   0:01.69 pdflush
140 root      10  -5     0    0    0 S  0.0  0.0   0:00.05 kswapd0
141 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 aio/0
299 root      11  -5     0    0    0 S  0.0  0.0   0:00.00 kpsmoused