PDA

View Full Version : [ubuntu] memory usage - understanding free command


nix4me
July 9th, 2009, 09:45 PM
I don't quite understand the output of the free command. I have a dedicated server running in a datacenter and I am unsure if I need more memory or not. Here is the output of the free command:

# free
total used free shared buffers cached
Mem: 507280 483332 23948 0 4312 181132
-/+ buffers/cache: 297888 209392
Swap: 1015800 38528 977272

Do I truly only have 23K of free memory? Or is the cached amount available too? How do I read the output to understand when i need to consider getting more memory?

bab1
July 9th, 2009, 10:09 PM
Thy using this:free -mt

This displays the memory in megabytes and with a total. If you wish you can use g instead of the m and it will read in gigabytes.

Mine displays as total used free shared buffers cached
Mem: 344 336 8 0 18 86
-/+ buffers/cache: 231 113
Swap: 1427 103 1323
Total: 1772 440 1332


The total line is useful here. I only have (roughly) 350 Meg if RAM on this host along with 1 GB of swap. The physical RAM will be used until there is a need to swap data to disk to accommodate more recent activity. Using most of the RAM is not a cause for concern until there is excessive disk I/O from using swap.