Monday, July 18, 2011

How To Check The Memory Usage in Debian / Fedora System

Free is one the linux command to display the total amount of free and used physical memory and swap memory in the system, as well as the buffers used by the kernel.

Display memory in MB :

$ free -m

Output :
                          total    used    free    shared   buffers    cached
Mem:                   564     495      68              0           67          147
-/+ buffers/cache:            280    283
Swap:                 1101        8   1093

Display total memory in an line:

$ free -mt

Output :
                          total    used    free    shared   buffers    cached
Mem:                   564     495      68              0           67          147
-/+ buffers/cache:            280    283
Swap:                 1101        8   1093
Total:                1666       557   1109

Some of the OPTIONS we can pass in free command as below :

-b Display the amount of memory in bytes.
-c count
Display the result count times. Requires the -s option.
-g Display the amount of memory in gigabytes.
-k Display the amount of memory in kilobytes. This is the default.
-l Show detailed low and high memory statistics.
-m Display the amount of memory in megabytes.
-o Display the output in old format, the only difference being this
option will disable the display of the "buffer adjusted" line.
-s Continuously display the result delay seconds apart. You may
actually specify any floating point number for delay, usleep(3)
is used for microsecond resolution delay times.
-t Display a line showing the column totals.
-V Display version information.

No comments:

Post a Comment