HowTo: Check RAM Size In Ubuntu Linux

by on February 1, 2010 · 5 comments· LAST UPDATED December 24, 2013

in , ,

How do I check amount of RAM in my Ubuntu Linux laptop or desktop system/server using GUI and command line tools?

There are various commands on Ubuntu Linux that can show you total RAM, used and free ram as follows:

Tutorial details
DifficultyEasy (rss)
Root privilegesNo
RequirementsNone
Estimated completion time2m
  • free command
  • top command
  • vmstat command
  • /proc/meminfo file.

Display available memory on Ubuntu Linux

Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following commands to view amount of free and used memory in the system including total ram:

 
free -m
 

Sample outputs:

             total       used       free     shared    buffers     cached
Mem:          7997       2618       5378          0        126       1353
-/+ buffers/cache:       1139       6858
Swap:        15623          0      15623

You can also use the following command to get same info:

 
grep MemTotal /proc/meminfo
 

Sample outputs:

MemTotal:        8189496 kB

The above output indicates that I've total 8GiB ram. You can get detailed info by typing the following cat command:
$ cat /proc/meminfo
Sample outputs:

MemTotal:        2050424 kB
MemFree:          649088 kB
Buffers:          304844 kB
Cached:           920136 kB
SwapCached:            4 kB
Active:           803628 kB
Inactive:         431560 kB
Active(anon):       3988 kB
Inactive(anon):     8628 kB
Active(file):     799640 kB
Inactive(file):   422932 kB
Unevictable:        2944 kB
Mlocked:            2944 kB
SwapTotal:       3998716 kB
SwapFree:        3998712 kB
Dirty:                20 kB
Writeback:             0 kB
AnonPages:         13296 kB
Mapped:            10364 kB
Shmem:               336 kB
Slab:             118192 kB
SReclaimable:     101820 kB
SUnreclaim:        16372 kB
KernelStack:        1240 kB
PageTables:         1740 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     5023928 kB
Committed_AS:      67748 kB
VmallocTotal:   34359738367 kB
VmallocUsed:       30748 kB
VmallocChunk:   34359698708 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       52096 kB
DirectMap2M:     2043904 kB

Other commands

You can use other commands to get the same info:
$ vmstat
$ top
### you need to install htop ##
$ htop

Related media

This tutorial is also available in a quick video format:


Video 01: Ubuntu / Debian Linux Ram (Memory) Usage Command Line Tutorial

GUI Tool To Find Out RAM Size Under Ubuntu Linux

The System Monitor application enables you to display basic system information and monitor system processes, usage of system resources, and file systems. You can also use System Monitor to modify the behavior of your system. To see memory information graphically, click on System > Administration > System monitor:

Fig.01: Ubuntu Linux Display Installed Memory

Fig.01: Ubuntu Linux Display Installed Memory

A note about 3GB ram problem

If your Linux based system only shows 3 GB ram (it may be in the 2.9–3.5 GB range) even if you got more than 3GB installed. You can get around this barrier running on x86 microprocessors by following this tutorial. The barrier can be resolved by moving to a 64-bit processor and operating system. On certain x86 hardware, it is possible to resolve it by using physical address extension (PAE) mode on x86.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 5 comments… read them below or add one }

1 colin little March 21, 2012 at 2:58 pm

Hi,ive just purchased a linux ubunto 11.10 desktop,from ebay,but its very slow loading games,how do i resolve this,where can i buy memory upgrades from. thanks Colin Little

Reply

2 Will May 16, 2012 at 12:51 pm

Thanks for this. Saved me some time.

Reply

3 sara July 31, 2012 at 8:52 am

hi, im using ubuntu 11.04 (natty)
why it shows 2.9 GB of RAM using system monitor…i think my RAM should be 4 Gig
where’s my 1.1 GB ??

Reply

4 Bobo_PK September 2, 2012 at 1:50 am

You are using a 32 bit version which can’t adress more then 3 GB. Use the 64 bit version to solve that!

Reply

5 nixCraft September 2, 2012 at 2:04 am

The faq has been updated to address these issues.

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: