Month: May 2010

Find Memory Or RAM And Swap Usage In Linux

RAM plays an important role in the performance of a system. So we should monitor this memory usage to troubleshoot system. free is the basic command to get details of RAM and swap usage. #freeExample :# free total used free shared buffers cachedMem: 3059872 2842016 217856 0 33936 2012684-/+ buffers/cache: 795396 2264476Swap: 2000052 67672 1932380 When you see its giving total size, used and free size in bytes. If you want to see in MB specify -m option in free #free -mExample :# free -m total used free shared buffers cachedMem: 2988 2784 203 0 33 1974-/+ buffers/cache: 776 2211Swap: 1953 66 1887 Any other commands to check RAM?The answer for this is yes.1. Use proc file system to get detailed RAM usage of the system. #cat /proc/meminfo2. Use top command to see RAM usage So with top too you can see RAM usage live. Please visit for more linux admin...

Read More

How To Find And Remove Core Files In Linux?

What is a”Core file” ? Ans : A core file is created when a program is crashed/stoped abnormally due to some bug. This will be huge size which contains all the memory info, crash info which is used for programmers to debug the issue and find a solution or patch to that bug. Why we system administrators are interested in that core files?Ans : This is because of their size. As we do monitoring of systems on daily basis but suddenly your disk is full one day when you came to office, you are total blank thinking how come disk is full though there is no much user activity etc. So core files are one reason which will eat up our disk. Which you have to check for when sudden disk activity is observed. How to find core files ? #find / -name core This find command will search entire filesystem for core files.. once you find them use rm command to remove those files..#rm -rf core So how it got its name?A core dump file gets its name from an old memory technology using tiny magnetic cores for storage. Please visit for more linux admin...

Read More

How To Kill Defunct Or Zombie Process?

A "defunct" processes is also known as a "zombie" processes. A Zombie process is referred as dead process which is receding on your system though its completed executing. In one shot we can say its a dead processes which is still in RAM. This process will be in your process table and consuming your memory. Having more defunct process will consume your memory which intern slows your system. We have to kill the defunct process in order to free RAM and make system stable. Why defunct process are created? Ans : When ever a process ends all the memory used by that process are cleared and assigned to new process but due to programming errors/bugs some processes are still left in process table. These are created when there is no proper communication between parent process and child process. Some FAQ? 1. How to find a defunct process? And : Grep defunct value in ps -ef output #ps -ef | grep defunct 2. How can I kill a defunct process? And : Just use kill command #kill defunct-pid 3. Still not able to kill? Ans : Then use kill -9 to force kill that process #kill -9 defunct-pid 4. Still have an issue in killing it? Ans : Then try to kill its parent id and then defunct. #kill parent-id-of-defunct-pid Then #kill -9 parent-id-of-defunct-pid 5. Still having defunct? Ans : If...

Read More

How To See Memory(RAM) Used By An Application Or Service?

Some times its required for us to know what is the RAM used by an application. Suppose in your machine Apache service or Mysql service is consuming up all your RAM. So how to check it? Is there any direct command to do this? The answer to this is no. We have to use two commands to do this. Here is the way to see what is the ram used by a particular Application. To see all the process run by a particular application, We can user pgrep(process grep). #pgrep application-name Example(in Ubuntu) #pgrep apache 1946 1951 1952 1954 1955 1957 2894 To see all the memory used by a process we use pmap(process mapping ). #pmap pid-of-that-application Example : # pmap 19461946: /usr/sbin/apache2 -k start 00110000 28K r-x– /lib/tls/i686/cmov/ 00117000 4K r—- /lib/tls/i686/cmov/ 00118000 4K rw— /lib/tls/i686/cmov/ 00119000 8K r-x– /usr/lib/apache2/modules/ 0011b000 4K r—- /usr/lib/apache2/modules/ 0011c000 4K rw— /usr/lib/apache2/modules/ 0011d000 8K r-x– /usr/lib/apache2/modules/ 0011f000 4K r—- /usr/lib/apache2/modules/ 00120000 4K rw— /usr/lib/apache2/modules/ 00121000 16K r-x– /usr/lib/apache2/modules/ 00125000 4K r—- /usr/lib/apache2/modules/ 00126000 4K rw— /usr/lib/apache2/modules/ 00129000 76K r-x– /lib/tls/i686/cmov/ 0013c000 4K r—- /lib/tls/i686/cmov/ 0013d000 4K rw— /lib/tls/i686/cmov/ 0013e000 8K rw— [ anon ] 00140000 32K r-x– /usr/lib/apache2/modules/ 00148000 4K r—- /usr/lib/apache2/modules/ 00149000 4K rw— /usr/lib/apache2/modules/ 0014a000 80K r-x– /lib/ 0015e000 4K r—- /lib/ 0015f000 4K rw— /lib/ 00160000 8K r-x– /lib/ 00162000 4K r—- /lib/ 00163000 4K rw— /lib/ 00164000...

Read More

How To See Total Processes Are Running, Files Opened, Memory Used By An User?

To see all the process run by a perticular user #ps -u username u -u used to specify user name, and u at the end of the command shows you complete path of the command executed. Example #ps -u rajesh u or To see all the files opened by user #lsof | grep username Example #lsof | grep rajesh To see memory used by a perticular user #ps -u username u | awk ‘{print $2}’ Example ps -u krishna u | awk ‘{print $2}’ Now you will get all the PID’s run by user Krishna. So try to get memory usage by using pmap command. Please visit for more linux admin...

Read More
  • 1
  • 2

Get latest updates for free..!

Enter your email address:

Delivered by FeedBurner

Pin It on Pinterest