Tuesday, December 21, 2010

How to know free memory on linux

Command to know free memory on Linux/Unix machines

$ free -m

It will show you status in MB. You can optionally use other filters as well

-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.

You can also use /proc/meminfo to see the current status of memory

$ cat /proc/meminfo

Sphere: Related Content

0 comments: