Linux Check Memory Usage

by on April 6, 2006 · 72 comments· LAST UPDATED January 7, 2013

in

How do I check used and free RAM memory usage under Linux operating systems using command line and GUI tools?

Linux comes with different set of commands to check memory usage. The free command displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel. The vmstat command reports information about processes, memory, paging, block IO, traps, and cpu activity. Finally, you can use the top, and/or atop/htop commands which provides a dynamic real-time view of a running system. top and friends can display system summary information as well as a list of tasks currently being managed by the Linux kernel.

Tutorial details
DifficultyEasy (rss)
Root privilegesYes/NO
RequirementsLinux/free command
top/atop/htop
Estimated completion timeN/A

/proc/meminfo

The /proc/meminfo file stores statistics about memory usage on the Linux based system. The same file is used by free and other utilities to report the amount of free and used memory (both physical and swap) on the system as well as the shared memory and buffers used by the kernel.

Example

Use the cat command or grep command to see /proc/meminfo file:
$ cat /proc/meminfo
$ less /proc/meminfo
$ more /proc/meminfo
$ egrep --color 'Mem|Cache|Swap' /proc/meminfo

Sample outputs:

MemTotal:        8120568 kB
MemFree:         2298932 kB
Cached:          1907240 kB
SwapCached:            0 kB
SwapTotal:      15859708 kB
SwapFree:       15859708 kB

free command

To display free memory size in MB (megabytes):
$ free -m
Sample outputs:

             total       used       free     shared    buffers     cached
Mem:           750        625        125          0         35        335
-/+ buffers/cache:        254        496
Swap:          956          0        956

Displays a line containing the totals memory in MB:
$ free -t -m
Output:

       total       used       free     shared    buffers     cached
Mem:           750        625        125          0         35        335
-/+ buffers/cache:        253        496
Swap:          956          0        956
Total:        1707        625       1082

So how much free ram I have?

Type the following command:
$ free -m
Sample outputs:

Understanding Free Command Output

Understanding Free Command Output


In this above output, my server has used 2825 MB ram, and 9083 MB is available for other users and programs.

A list of free command options

  -b,-k,-m,-g show output in bytes, KB, MB, or GB
  -l show detailed low and high memory statistics
  -o use old format (no -/+buffers/cache line)
  -t display total for RAM + swap
  -s update every [delay] seconds
  -c update [count] times

vmstat command

Type the vmstat command at shell prompt:
$ vmstat
Sample outputs:

procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa
1  0      0 131620  35432 341496    0    0    42    82  737  1364 15  3 81  1

top command

Type top command at the shell prompt:
$ top
Sample outputs:

Fig.01: top command displaying used memory

Fig.01: top command displaying used memory


To exit from top command type q key.

atop command

The program atop is an interactive monitor to view the load on a Linux system. This program can display the amount of used and free memory. It is similar to top command but comes with additional advanced options. By default, the atop command is not installed on most Linux distributions.
$ atop
Sample outputs:

Fig.02: Linux Check Amount Of Memory With atop Command

Fig.02: Linux Check Amount Of Memory With atop Command

htop command

The program htop is an interactive process viewer. It is similar to top, but allows to scroll the list vertically and horizontally to see all processes and their full command lines.
By default, the htop command is not installed on most Linux distributions.
$ htop
Sample outputs:

Fig.03: Linux Check Amount Of Physical Memory With htop Command

Fig.03: Linux Check Amount Of Physical Memory With htop Command

GNOME Desktop: GUI tool to see memory usage

The "Gnome 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. You can start System Monitor by visiting System menu > Choose Administration > System Monitor option. Or type the following command at the shell prompt:

 
gnome-system-monitor
 

Sample outputs:

Fig.04: Linux See Memory Usage With GUI System Monitor Tool

Fig.04: Linux See Memory Usage With GUI System Monitor Tool

Check out related media



(Video 01: Top five commands to see used and free memory under Linux)

A note about the performance

  1. RAM - An occupation percentage of 90% is considered as critical.
  2. SWAP - An occupation percentage of 80% is considered as critical.
  3. To solve performance related problems, add more RAM and increase the swap space (or move swap space to another disk controller).

Read man pages of free, vmstat, top, atop, and htop commands for more information.

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

{ 72 comments… read them below or add one }

1 suresh September 12, 2007 at 8:12 am

Hi ,

I need a unix command to get the total memory usage percentage.so that i can call this command from java.The output of the command should only be the percentage of memory utilization.

thanks
Suresh

Reply

2 Matt November 30, 2007 at 4:01 pm

Try:

ps aux | awk ‘{sum +=$4}; END {print sum}’

Bye!

Reply

3 Michael December 6, 2007 at 4:00 pm

Using the command free, vmstat, top all shows it uses almost 100% of the memory. But if I use the system monitor, it will show only less than 10%.

I am using CentOS 5. can anyone explain why the free, vmstat, top all displaying wrong information? Thanks.

$ free -m
total used free shared buffers cached
Mem: 3792 3638 154 0 128 3231
-/+ buffers/cache: 277 3515
Swap: 1983 0 1983
$ vmstat
procs ———–memory———- —swap– —–io—- –system– —–cpu——
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 108 158380 131948 3309388 0 0 106 75 203 180 0 0 98 1 0

Reply

4 Selan October 6, 2011 at 1:12 am

Cached memory is a kind of free memory.

Reply

5 Atahan February 1, 2008 at 7:30 am

Actualy memory is not used by application, but it is used for disk caching.
If memory is not fully utilized by kernel than it is wasted, by keeping data in cache when an application needs data again it can be provided faster.
If you want to see the memory from the perspective of application you should look at +- buffers/cache line, the free column of this line shows you the memory that can be used for applications.

In the case below my application using 2GB of memory.

# free -m
total used free shared buffers cached
Mem: 7973 7323 650 0 128 5152
-/+ buffers/cache: 2042 5931
Swap: 8189 40 8149

Reply

6 Ganesh March 9, 2011 at 8:56 pm

Thank you.

Reply

7 Ohm May 20, 2008 at 4:15 am

Hi ,

I take care 2000 PCs that using Redhat 7.3. I’m finding the command to create script file to check RAMBus of the PCs. Could you please help to recommend the appropriate one ?

Thanks.

Regard,

Reply

8 pudhiyavan June 19, 2008 at 6:49 pm

is there any way/script to find out physcial memory usage exclusive of buffer/cache usage??

Reply

9 don August 6, 2008 at 9:28 am

very good
thanks
Regard,

Reply

10 Shaukat Ali Gill November 9, 2008 at 1:58 pm

You can also check memroy by using command “cat /proc/meminfo” it will give you detail info.

Reply

11 Duncan December 5, 2008 at 8:23 pm

the memory information is also stored in /proc/meminfo… so just in case you don’t have any tools installed… cat /proc/meminfo

Reply

12 mouli August 25, 2011 at 5:27 am

i am expecting a command to see memory information. you said cat /proc/meminfo ,it is for seeing the configuration file right… is there any possibility to get the details of memory directly..

Reply

13 amm January 10, 2009 at 1:03 pm

hi all

I use sun servers and solaris os and memory load has been increased to 90%

I need to know which command can i use to check on its memory and how i know the abnormal increase

Reply

14 kshard January 22, 2009 at 1:06 pm

hi all

I am trying to get the output of the command top in java using a processbuilder. But its not giving any output. Though a command such as ‘ps -all’ is giving the required output. Can anyone help please. Its urgent…

Thanks

Reply

15 team fortress January 23, 2009 at 10:05 pm

How can I find the memory used by each php script on the server?

Reply

16 kishore February 21, 2009 at 10:55 am

hi this is kishore

with single command can we get information of version of linux , ram,and memory status informationa. And as well as with single command the total system information
can i know the comman of linux

Regards
kishore

Reply

17 Oink! March 30, 2009 at 7:51 am

[kishore] You need to write a script which excutes various commands and output as a single command.

Reply

18 Psycho Tux April 30, 2009 at 9:01 am

ps aux | awk ‘{sum +=$4}; END {print sum}’. It works.
Thanks Matt…
Is there any way to do the same for SWAP also.

Reply

19 Ajay Kumar Bysani June 15, 2009 at 6:36 am

How can get the average memory usage of a perl script that I am running on a linux machine? Can anybody help?

Reply

20 T Sudhakarraj August 13, 2009 at 4:22 am

Hi kishore

Use this coomand to get all the required information

lsb_release -a && free -m

Reply

21 Paul Plowman September 3, 2009 at 4:54 pm

Believe that we have a memory leak on RHEL 4.5 with Java & Apache running.

ps -eo pid,ppid,rss,size,vsize,sz,pmem,comm | awk '{ rss += $3; size += $4; vsize += $5; sz += $6; pmem += $7} ; END { print "rss = "rss" size = "size" vsize = "vsize" sz = "sz" pmem = "pmem }' ; free -m
rss = 4590060 size = 7302928 vsize = 11360544 pmem = 26.7
total used free shared buffers cached
Mem: 16028 15979 48 0 0 24
-/+ buffers/cache: 15954 73
Swap: 32767 4571 28196

Does anyone have a command, code, or program to identify where the memory is being utilized?
After a reboot the server is using 24.6% of memory or free shows 4869 MiB.

Thanks.

Reply

22 T Sudhakarraj September 4, 2009 at 7:13 am

Hi Paul,

ps -auxf | sort -nr -k 4 | head -10

The above mentioned command will display top 10 memory usage in % by each process

Reply

23 jetole November 21, 2010 at 3:28 pm

T Sudhakarraj, This is a great answer in order to see the top 10 application based on the percent usage but I thought I could help improve it a little. As you probably know, most hard core/old school bash programmers often object to using more commands then you need to get the output you want. When you are performing this command, it’s important to realize that the percentage shown is a reflection of the RSS size of that application and it does not consider RAM allocated by shared objects / dynamically linked libraries (I hate using that term since most people associate it with Windows DLL files but dynamically linked library, while the proper term in Windows is also the generic term to refer to these types of libraries / objects on any OS).

Because the percentage of RAM shown in ps for any output that uses the %mem / pmem format specifier is in direct correlation with host much data that application has in RSS relative to how much physical ram the host has, you can sort the ouput in ps yourself by using the `–sort rss` option. The final command would look like:

ps -A --sort -rss -o comm,pmem | head -n 11

The output would look like:

COMMAND         %MEM
kvm              5.6
thunderbird-bin  3.0
java             2.4

This will give you the 10 processes using the most ram ( I only showed 3 in my example) as well as the ps header describing each field. If you want to remove the header then you can add the option “–no-headers” (without the qyuotes) to ps. If you remove the headers in ps, you will probably want to change the head command to use 10 instead of 11 since the extra line is for the headers Also this example only shows the “short” command name or basically it only shows the command but non of the arguments. It also doesn’t show the actual amount of RSS being used. If you want to show the “long” command or basically the command name with all the arguments, replace “comm” with “cmd” in the ps options. If you want to display the actual amount of RSS being used by each app in the top 10 list, replace “comm,pmem” with “comm,pmem,rss” and it will now have three columns for command, percent of memory and kilobytes of RSS used instead of just command and percent of memory.

Also, unfortunately ps doesn’t have the option to convert kilobytes to megabytes. This can still be displayed but it requires a bit more of a complex answer. In order to display the RSS usage in megabytes instead of kilobytes we run through a loop and do the math ourselves on each line.


while read command percent rss; do if [[ "${command}" != "COMMAND" ]]; then rss="$(bc <<< "scale=2;${rss}/1024")"; fi; printf "%-26s%-8s%s\n" "${command}" "${percent}" "${rss}"; done < <(ps -A --sort -rss -o comm,pmem,rss | head -n 11)

The example below calculates the megabytes used by each applications RSS rounded to nearest 100th of a whole number. You can change this to show more or less places after the decimal by changing "scale=2" to whatever number you like.

Hope this helps some people.

P.S.: I saw that the term RSS was used by someone before me but I don't see anywhere on this thread where anyone has defined it. RSS as it relates to RAM (on any OS as far as I know) is the portion of memory that a process is using that is held in RAM. Every process has RSS and RSS does not include any items in RAM which have been swapped to disk or are otherwise anywhere else then in the physical RAM. This means that the size of each programs RSS is the amount of data that program itself is storing in physical RAM.

Reply

24 NoNeedForAName April 15, 2012 at 6:52 pm

Hope this helps some people.

Yes, yes it does. Bloody Apache. Thanks jetole.

Reply

25 azaz mustafa June 10, 2010 at 10:39 am

Actualy memory is not used by application | swap file memory is 1534196 and uses 0
so pleas solution

Regard
azaz

Reply

26 dipul June 11, 2010 at 9:43 am

how we can know status of the RAM through the JAVA Programming?
plz

thanks

Reply

27 Mohammed August 5, 2010 at 11:30 am

Hi All,
We use a hospital Information system application. From 10:30 AM the performance becomes really slow and the application freezes. Not sure if it is due too many sessions open or number of client connections or cpu/memory issue.
We have the application installed on all client machines. The application server running on RHEL 5.2 version on IBM Balde work stations with 2 node cluster. App server is connected to Oracle 11g Db server.
Currently, we restart the the application server every 2 days after working hours and see that the performance back to normal. But if we do not restart the servers, the performance is bad again.
Please let me know what all things I need to check here so to know what is causing the performance issue.

Regards
Mohammed

Reply

28 Techie Talks September 28, 2010 at 4:56 am

Try to kill unused running commands/applications.

Reply

29 Krunal September 17, 2010 at 6:39 pm

I want to get the cat output in memory buffer. Can anybody please let me know how it is possible.

Reply

30 BK September 22, 2010 at 4:32 am

Hello…
Can you pleas tell me how can I check Guaranteed Ram and Burstable Ram from shell prompt?

Thanks alot

Reply

31 Techie Talks September 28, 2010 at 4:53 am

cyberciti has been my partner since we had linux servers in the office, thank you and hope you will continue this site and more power to the webmaster and all its staff.

Reply

32 NoNeedForAName April 15, 2012 at 6:53 pm

Seconded. Cyberciti is better than

man

.

Reply

33 bharath vn October 25, 2010 at 11:54 am

Hey guys,

i see my sites apache uses more memory around 4G, after restarting it release 3G.

The actual problem is Apache keeps increasing its memory usage.

Do you guys know how to overcome this issue.

Thank You

Reply

34 maclean November 5, 2010 at 7:07 am

Linux memory management is more flexible than windows

Reply

35 muthukumar November 16, 2010 at 8:21 am

Hi guys,

how to setup the IP address in running production server

thanks in advance
muthukumaran.g

Reply

36 mahes November 30, 2010 at 10:44 am

hi guys.
The top 10 application are using 0% mem for ME …but top says..

Mem: 4145948k total, 2776936k used, 1369012k free, 146512k buffers
Swap: 1558296k total, 4k used, 1558292k free, 2467592k cached

out of 4G ram 2.6 is already used..WIll the kernel allocate if a process require more than the free memory. Wat process is actually using the used one .??

kindly help me with this.

n 11id:/localdisk/lattice/lattice_36041# ps -A –sort -rss -o comm,pmem | head
COMMAND %MEM
ntpd 0.0
named 0.0
vim 0.0
bash 0.0
sshd 0.0
sshd 0.0
sshd 0.0
sshd 0.0
bash 0.0
sshd 0.0

Reply

37 jetole November 30, 2010 at 3:29 pm

I see your using the command I mentioned above but with one less item in the head command output but that’s alright ;)

You can show the same data, without limiting the input but also displaying the RSS usage (and the pid) for each process by running:

ps -A –sort -rss -o pid,comm,pmem,rss

The far right column will show you the RSS usage in kilobytes. The order is descending so the application with the highest allocated RSS (using the most) is at the top of the list. The application with the lowest allocated RSS (using the least) is at the bottom of the list. Remember that RSS is only referring to the memory you application is using that is actually in RAM and does not include anything swapped to disk so this is in fact the amount of RAM your application is using.

Something important though that you may not have realized is that Linux tends to use almost all available memory whenever it can by default. Linux will leave an percent free (I don’t know how to check what the percent is but it doesn’t matter) and then it will allocate the rest to buffers and cache. The general idea is this, buffers is the smaller segment it allocates for I/O usage of processes that are running. This mostly refers to items that programs need to write to a disk but that data is often cached in memory and then written. This causes programs not to have to wait for I/O to complete and the kernel is then able to write the data to disk as quickly as it’s capable of doing but at the same time without having to have a program and hence the user wait for the information to be written to disk. The buffers are also used for IPC or inter process communication. The cache is mostly used for reading files off disk. The algorithm is uses, while complex, basically stores a combination of files that are popular and recent in cache memory. This speeds up disk read times a lot too. You will notice that the cache is almost always significantly larger then the buffers. You can view both of these using free to see total, used and free memory. You can use free -m for megabytes and free -g for gigabytes.

This RAM, more quickly with cache then buffers, can be very quickly (on both) be released and therefor given to any process asking for RAM. This means that, although this RAM is used and it is used in way that speeds up your system, if any task needs the RAM, it will instantly be given to that process. One example would be if I start VLC movie player and VLC needs and therefor requests 50MB to run, then the kernel will free 50MB from cache and buffers and allocate it to VLC. This is why there is also a line when you run free which says “-/+ buffers/cache”. This line which shows numbers under used and free, isn’t the RAM you literally have used and literally have free because of ram allocated to cache and buffers, however it is the line you should refer to when you want to see how much free RAM you have because RAM allocated to buffers and cache will be instantly released and given to a process whenever it needs it.

When you view your free memory inside top, it shows you the literally used RAM and literally free RAM meaning cache and buffers are added to used and subtracted from free and their is nothing wrong with this but the RAM inside cache and buffers is still available to you when you need it. As I mentioned, the best way to really see how much used and free RAM you have is to look at the “-/+ buffers/cache” line inside free. That line is there for a reason.

Hope this helps.

Reply

38 jetole November 30, 2010 at 3:36 pm

Ah I forgot that the forum breaks double hyphens by default (poor mans attempt to stop SQL injections maybe?). The actual command I have up top is

ps -A --sort -rss -o pid,comm,pmem,rss

Notice the double hyphens in front of sort.

Reply

39 Ashok December 9, 2010 at 5:08 pm
#################################################################
# Developed by Ashok Kumar
# 1:50 PM Monday, February 04, 2008
#################################################################
TOT=`cat /proc/meminfo | grep MemTotal: | awk '{print $2}'`
USED=`cat /proc/meminfo | grep Active: | awk '{print $2}'`
FREE=$[$TOT - $USED ]
LOG=/tmp/mem_monitor.log
echo > $LOG
SEND=0
if [ "$USED" -gt "0" ]; then
   USEDPERC=$[$USED * 100 / $TOT]
   echo "Used Percentage      : $USEDPERC %"
   TOTMB=$[$TOT / 1024 ]
   USEDMB=$[$USED / 1024 ]
   FREEMB=$[$TOTMB - $USEDMB ]
   #echo "Used Percentage : $USEDPERC"
   if [ "$USEDPERC" -gt "80" ]; then
     SEND=1
     STATUS="Warning"
     echo "------------------------------------------------------------------" >> $LOG
     echo `hostname`   >> $LOG
     echo "------------------------------------------------------------------" >> $LOG
     echo "Total Memory (MB)    : $TOTMB" >> $LOG
     echo "Used Memory (MB)     : $USEDMB" >> $LOG
     echo "Free Memory (MB)     : $FREEMB" >> $LOG
     echo "Used Percentage      : $USEDPERC %"  >> $LOG
     echo "------------------------------------------------------------------" >> $LOG
     if [ "$USEDPERC" -gt "95" ]; then
        STATUS="Critical"
     fi
   fi
fi
if [ "$FREEMB" -eq "0" ]; then
   SEND=1
   STATUS="Fatal"
   echo "------------------------------------------------------------------" >> $LOG
   echo "    No free memory available in " `hostname`    >>$LOG
   echo "------------------------------------------------------------------" >> $LOG
fi

Reply

40 Ashwin March 23, 2011 at 1:15 am

Awesome!!..
Thanks Ashok

Reply

41 mahes December 1, 2010 at 6:10 am

“jetole
.
.
Hope this helps.”

Thanks a lot boss , great explanation . is of great help to me as i am able to free up my mem , used by so many ssh process :)

Reply

42 riyan December 3, 2010 at 4:49 am

Hi, Great Article. is there any way to find the memory usage history of SUSE Linux server?

Reply

43 jetole December 3, 2010 at 11:20 am

riyan,

Yes and no. Generally speaking, Linux the kernel doesn’t do any real auditing / logging of memory usage but then again it shouldn’t either since Linux really is only a kernel so you will need to install another tool to deal with this. The most common / popular / recommended tool for this would be sysstat / sar and on quite a few distros (Debian, Ubuntu, CentOS), sysstat is the literal name of the package you want to install. Once installed, it will start logging the data but their really is no way for it to record data from before it was installed so basically, if you don’t have a audting / logging application like sysstat already installed then you can’t really view the past history until after it is.

Reply

44 Vaseem January 7, 2011 at 4:44 am

you can try from the terminal
cat /proc/meminfo
cat /proc/cpuinfo
This will give you information regarding the memory and CPU

Reply

45 mouli August 25, 2011 at 5:32 am

they both are shows the configuration information…
and the command to see the cpu information is ”lscpu”

Reply

46 Sandeep March 9, 2013 at 10:19 am

Exactly! You simply figured out this…

Reply

47 Itzekocke April 12, 2011 at 11:28 am

Thanks,

that all helped a lot – even if the information is more than 5 years old!

Itzekocke

Reply

48 peter May 1, 2011 at 4:12 pm

fantastic article! thanks very much for your thourough and clear explaination, great job!

Reply

49 pat July 31, 2011 at 12:04 am

Hi Im new to linux and have an older acer 340t travel mate i went into BIOS but didnt see how much memory i have..How to i get into where i can type commands to fine out how much memory It has and what would the command be. Thank you so much for your help

Reply

50 Tryme July 31, 2011 at 11:19 pm

Open a command-line terminal (select Applications > Accessories > Terminal), and then type:

free -m

Reply

51 Timothy Asir August 10, 2011 at 9:11 am

MemUsed = MemTotal – MemFree – Buffers – Cached

We can take the values from /proc/meminfo and calculate this;
and can verify with gnome-system-monitor output.

Reply

52 Aziz Zoaib September 28, 2011 at 5:19 am

How to check CPU and memory utilization of previous days ?

any commands ?

Reply

53 Timothy Asir September 30, 2011 at 9:49 am

Then, you have to use RRD.
1) create an RRD (database) for CPU and memory utilization using rrdtool. You can also write a script to do that using perl or python. In perl you can use (RRDs::create).

2) Update the RRD with cpu and memory details periodically (on every 5-mints or hour)

3) Use rrdtool xport / rrdtool graph command to get details of a specific period (hour/day/week/month/year)

Reply

54 jetole September 30, 2011 at 11:20 am

Timothy,

That’s rather crude. You don’t need to program anything to get these stats nor do you need to write RRD scripts. One method that has been used by many system administrators for a long time is through sysstat though this is all console based. If you prefer a web based GUI with RRD graphs then cacti is already programmed to monitor all of this for you. There are also probably several dozen other ways to do this so you probably shouldn’t use terms like “Then, you have to use RRD”. Because you only know one way to do it doesn’t mean it’s the only way and you shouldn’t be dismissive.

P.S.: You’re explanation seems to be lacking lacking a lot and the first thing I notice is how often you update the RRD is based on how often you have configured and RRD to be updated. An RRD database designed to be updated every 5 minutes would be pretty much useless if you update it every hour based on the way RRD is designed to implement this data. A better approach is to log this data (at least) twice as often you want it to be available, for example, if you want a daily bar graph of cpu usage with 48 points of input from data collected every 1/2 hour then log the data at least every 15 minutes. When you are you want to view this data then you dynamically create the RRD based on the the specifications you supply at the time and this way you are not bound to one poorly designed RRD component which you may have implemented ‘a long time ago” and now you are forced to use it even though you need statistics at an entirely different rate then what you had originally planned “way back when”

Reply

55 jetole September 30, 2011 at 11:21 am

P.P.S.: I forgot to mention Munin which is another web based RRD based performance monitoring application.

Reply

56 jetole September 30, 2011 at 11:31 am

One more P.S.: I use sysstat, cacti, munin and more to monitor the server farm I am responsible for. They all provide the same details in a general sense but in a detailed sense they are all different from one another in a way that one doesn’t entirely replace the other and I feel it’s best to implement whatever provides you with the details you need in a useful and efficient manner and if this means you have to use more then one tool for different ways to comprehend the data then there is nothing wrong with that. This isn’t Windows where you have to worry about product cost, contract lock in’s and vendor abuse so install 10 products if you need it and if you decide to install 20 just to see which ones ultimately give you the info that you need then there is nothing stopping you (at least not for most Linux tools. I can’t speak for all of them).

Reply

57 sureshatt October 10, 2011 at 6:49 am

thanks dude, nice tutorial

Reply

58 Ravinder Kumar October 13, 2011 at 1:52 pm

Hi ,

I have problem in one linux application server where 3 instaces is running of java, each instaces is alocated 1 gb memory but my server is using my 21 gb memory , i am surprised for this.

Can anyone help me , i checked with many command but nothing found….

Thanx in advance….

Reply

59 Jussi November 27, 2011 at 11:03 am

You folks might be interested in systemgraph named data collector/rrdtool/web cgi framework, that produces easily many kind of stats for system resource usage; see http://www.decagon.de/sw/systemgraph/

Reply

60 escorte December 23, 2011 at 8:42 am

Any ideea why on a CentOS 5.7 Final linux box, 64 bit version, my system only recognized 3261 MB RAM instead of 4 GB installed? When it boots and also in BIOS all 4 GB ram are shown, but under linux I only see 3,2 GB. Thanks!

Reply

61 nixCraft December 23, 2011 at 9:48 am

Are you sure you got 64 bit CentOS Linux? 64 bit can address 4Gib and more ram without any problem.

Reply

62 Nirav February 15, 2012 at 2:49 pm

How can I find only memory utilization [not in percentage] and only I/O utilization [not in percentage].

Reply

63 Jason February 17, 2012 at 2:14 pm

I recently discovered “htop”. This is a really nice tool to see your resources being used via your terminal and even offers point and click functionality!

On Redhat-based systems simply type:
# yum install -y htop

Then from the command-line run:
# htop

Reply

64 jetole April 15, 2012 at 7:26 pm

Nirav,

free (-k -m or -g for showing in kilo, mega or gigabytes) for memory usage
iostat for disk io. Should be part of the systat package

Reply

65 vivek July 2, 2012 at 10:38 am

Hello all,

Please let me know when i run command free -m on any linux box with 8GB assign ram it show me 7873 MB please let me know is linux kernel reserved any memory or where is 319 mb memory is use.

Reply

66 Chirag August 14, 2012 at 6:54 am

Thanks. Awesome guide

Reply

67 sanjay March 5, 2013 at 7:02 am

hi sir
Iam using linux os in friendlyARM
I am having 64 MB of ram so it is using 64 MB but i want to limit it, it
means i want 100 kb memory for future usage so restrict 64 MB ram to
(64MB-100KB) (shortly: don’t use last 100 KB ram)
command to overcome with program consuming too much RAM
how it can be done ….can any one suggest me

Reply

68 linux admin April 3, 2013 at 5:34 pm

Anyone know how to find out what type of ram the server uses and how many sticks by command with Linux 6?

For example my server has 4 gigs of ram, I am trying to find out if it has 4 1gb sticks or two 2gb sticks.

Also I am trying to find what kind of ram, for example if it’s ddr3 1600

Thanks!

Reply

69 jetole April 4, 2013 at 4:09 pm

lshw. comes standard on many systems including debian, ubuntu. etc. Last time I looked at rhel, cent, etc you need to add a third party repo.

Reply

70 Jose Tapia April 13, 2013 at 6:53 am

Great article, saving on bookmars :D

Reply

71 Silver Moon June 12, 2013 at 1:12 pm

Thanks for the great tutorial.
Really helpful in monitoring the resource usage on my server.

Reply

72 Chowdary August 6, 2013 at 3:32 pm

Hey All,

How do I get the memory usage details in last 5 hours ? or let’s say Last few hours?

Please suggest.

Thanks

Reply

Leave a Comment

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

Previous Faq:

Next Faq: