There are various commands on Ubuntu Linux that can show you total RAM, used and free ram as follows:
Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | No |
Requirements | None |
Time | 2m |
- 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:
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.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 12 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
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
Sell it..
Thanks for this. Saved me some time.
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 ??
You are using a 32 bit version which can’t adress more then 3 GB. Use the 64 bit version to solve that!
The faq has been updated to address these issues.
i have ubuntu 14.04 LTS, and this system error comes up a lot saying that i need to upgrade my video card, is that just a glitch or a virus, what is it, and what should i do?
i m install ubuntu 15.10 64 bit
but my 4gb ram is not so only so 2.9gb
i m also following command
free -m
sudo dmidecode -t 17
-t 17 so the 2,2gb ram in to too slots
but not so total 4 gb ram
pls tall me what type of command run in my system
first do this cmd in terminal
(1) sudo apt-get update
after second command
(2) sudo apt-get install linux-generic-pae linux-headers-generic-pae
this command download approx 32 mb and after auto apply and reboot require so reboot pc and check
always a great help
oh. I was looking for how to find max supported ram of mobo via xubuntu tools …
… found it. This will tell you the max supported ram by your system and number of slots.
sudo dmidecode -t 16