Chapter 2. Monitoring and benchmark tools 47
Draft Document for Review May 4, 2007 11:35 am 4285ch02.fm
Figure 2-1 free command output
Useful parameters for the free command include:
-b, -k, -m, -g display values in bytes, kilobytes, megabytes, and gigabytes.
-l distinguishes between low and high memory (refer to 1.2, “Linux memory
architecture” on page 11).
-c <count> displays the free output <count> number of times.
Memory used in a zone
Using the -l option, you can see how much memory is used in each memory zone.
Example 2-8 and Example 2-9 show the example of free -l output of 32 bit and 64 bit
system. Notice that 64-bit system no longer use High memory.
Example 2-8 Example output from the free command on 32 bit version kernel
[root@edam ~]# free -l
total used free shared buffers cached
Mem: 4154484 2381500 1772984 0 108256 1974344
Low: 877828 199436 678392
High: 3276656 2182064 1094592
-/+ buffers/cache: 298900 3855584
Swap: 4194296 0 4194296
Example 2-9 Example output from the free command on 64 bit version kernel
[root@lnxsu4 ~]# free -l
total used free shared buffers cached
Mem: 4037420 138508 3898912 0 10300 42060
Low: 4037420 138508 3898912
High: 0 0 0
-/+ buffers/cache: 86148 3951272

#free -m

total used free shared buffers cached

Mem: 4092 3270 826 0 36 1482

-/+ buffers/cache: 1748 2344

Swap: 4096 0 4096

free
memory
(KB)
used
memory
(KB)
shared
memory
(KB)
buffer
(KB)
cache
(KB)
Free= 826(MB)
Buffer=36(MB)
Cache=1482(MB)
Used=1748(MB)
memory 4GB
Free= 826(MB)
Buffer=36(MB)
Cache=1482(MB)
Used=1748(MB)
memory 4GB
total amount
of memory
(KB)
Mem : used = Used+ Buffer + Cache / free = Free
-/+ buffers/cache : used = Used / free = Free+ Buffer + Cache