How much RAM does my Ubuntu / Fedora Linux desktop PC have?

by on April 25, 2007 · 13 comments· Last updated July 26, 2007

Here is one of the most frequently asked questions from my mailbag:

Hey I need to know how much ram memory I have in my Ubuntu Linux computer. Under Windows XP I can find out memory by visiting Start > Control Panels > System in control panel. So how do I find out RAM information under Linux PC?

The best way to find out RAM information is open a terminal and type the following command:

$ free -m
OR
$ free -mt
Output:

             total       used       free     shared    buffers     cached
Mem:          2008       1837        170          0         50        963
-/+ buffers/cache:        822       1185
Swap:         1027          0       1027

free command print the total amount of free and used physical and swap memory in the system, as well as the buffers used by the Linux kernel. You can pass following options

  • -b switch displays the amount of memory in bytes
  • -k switch (set by default) displays it in kilobytes
  • -m switch displays it in megabytes.
  • -t switch displays a line containing the totals.
  • -o switch disables the display of a "buffer adjusted" line. If the -o option is not specified, free subtracts buffer memory from the used memory and adds it to the free memory reported.
  • -s switch activates continuous polling delay seconds apart. You may actually specify any floating point number for delay, usleep(3) is used for microsecond resolution delay times.

GUI tool - gnome-system-monitor

The gnome-system-monitor provides an overall view of the resource usage on your system, including memory and CPU allocation. Start gnome-system-monitor from Menus or just type:
$ gnome-system-monitor &
overall view of the resource usage  on  your Linux  system,  including memory and CPU allocation.

Another Good system monitor - Conky

Conky is a system monitor for X originally based on the torsmo code but kickass :). Run apt-get command to install conky:
$ sudo apt-get install conky

Conky can display just about anything, either on your root desktop or in it’s own window. Conky has many built-in objects, as well as the ability to execute programs and scripts, then display the output from stdout.

To start conky copy default config file and type conky at shell prompt:
$ zcat /usr/share/doc/conky/examples/conkyrc.sample.gz > .conkyrc
$ conky &

OR
$ conky -a left_top &

A system monitor for X originally based on the torsmo code

Read man page of conky for more customization options.

phpSysInfo - PHP script that displays information such as RAM, CPU et all

You can obtained pretty much same information over Internet using webbased php tool called phpSysInfo.

PHP script that displays information such as RAM, CPU
(click to enlarge)

I'd love to hear if anyone has used additional cool GUI tool like conky for this kind of system analysis/monitoring.



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 13 comments… read them below or add one }

1 xio April 25, 2007 at 11:16 am

> I’d love to hear if anyone has used additional cool GUI tool
Heh, ksysguard of course! Much more flexible than other tools.

Reply

2 vivek April 25, 2007 at 11:45 am

xio,

Just installed ksysguard, looks good and very simple :)

Reply

3 xio April 25, 2007 at 4:47 pm

vivek,

The point is that you can create as many tabs as you wish with arbitrary number of graphs – just drag’n'drop a sensor from the left panel (choose from _lots_ of them), then you will be promted for the graph type. After that it will be possible to set many different properties for the graphs. I call this ‘flexibility’ and it is IMO KDE by its nature :)

Reply

4 xio April 29, 2007 at 3:51 pm

Gah! Vivek, `cat /proc/meminfo` :)

Reply

5 vivek April 29, 2007 at 6:28 pm

xio,

Heh, somehow I missed that one too but for newbie free command is the best way to go, IMPO

Reply

6 sethu May 4, 2007 at 3:00 am

Latest version of linux will wwokr
free -g :# will show in GB

Reply

7 Anjanesh February 28, 2009 at 10:38 am

username@ubuntu:~$ free -m
total used free shared buffers cached
Mem: 2007 1594 412 0 48 833
-/+ buffers/cache: 713 1294
Swap: 3153 2 3151

But gnome-system-monitor shows 765MB of 2GB used ! How come the difference ?

Reply

8 awned July 27, 2009 at 9:25 pm

Ananesh,

free -m barely uses any memory where ass gnome-system-monitor has to load itself into the ram, thus the difference ;)

Reply

9 sudharsan April 28, 2010 at 7:46 am

how to check size in gb or mb , guide me which command i have to type ,
and putty is not connecting to ubuntu machines yyyyyyyyy

Reply

10 Will February 4, 2011 at 1:05 pm

That phpsysinfo link is great. Thanks for the tip.

Reply

11 ben May 16, 2011 at 12:09 pm

My favorite tool is htop

I run it on Linux and Mac os X

Reply

12 narcissus July 16, 2011 at 8:54 pm

watch -n.1 ‘cat /proc/interrupts ‘
watch -n.1 ‘cat /proc/meminfo’
………..
?

Reply

13 sasa July 17, 2011 at 7:35 pm

i use this command “top” :)

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 5 + 11 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Tagged as: , , , , , ,

Previous post:

Next post: