Tuesday, July 16, 2013

Linux Free command explanation

In Linux, free command is used to get the information about the physical memory usage. However, understanding the output of free command is little tricky.
This article explains the output of the free command and shows the calculations to find the actual physical memory available for use by the applications.
Following is the typical output of ”free -m’ on an RHEL server.
# free -m
                   total       used       free     shared    buffers     cached
Mem:          4033       2807       1226          0        124        937
-/+ buffers/cache:      1746       2287
Swap:         5535       1337       4198
Let’s try to understand the meaning of each field.
Linux Free Command Output Explained
So you can see that although free physical memory is reported as 1226 MB, the actual memory available for the processes is 1746 MB. Let’s put all these in a set of formulas,
Total Physical Memory Available (RAM)      : 4033 MB
Used Physical Memory                                 : 2807 MB
Memory used by Kernel Buffers                  :    124 MB
Memory Used by Kernel Cached                 :   937 MB
Total memory which is used by the kernel but can be reclaimed :  124 MB + 937 MB = 1061 MB
Actual Used Physical Memory (Memory Used by Apps) : 2807 MB – 1061 MB = 1746 MB
Actual Free Physical Memory (Memory Available For Apps) : 1226 MB + 1061 MB = 2287 MB

No comments:

Post a Comment