Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Possible Duplicate:
How to understand the memory usage and load average in linux server

This is the output of free -m on a production database (MySQL with machine. 83MB looks pretty bad, but I assume the buffer/cache will be used instead of Swap?

[admin@db1 www]$ free -m
             total       used       free     shared    buffers     cached
Mem:         16053      15970         83          0        122       5343
-/+ buffers/cache:      10504       5549
Swap:         2047          0       2047

top ouptut sorted by memory:

top - 10:51:35 up 140 days,  7:58,  1 user,  load average: 2.01, 1.47, 1.23
Tasks: 129 total,   1 running, 128 sleeping,   0 stopped,   0 zombie
Cpu(s):  6.5%us,  1.2%sy,  0.0%ni, 60.2%id, 31.5%wa,  0.2%hi,  0.5%si,  0.0%st
Mem:  16439060k total, 16353940k used,    85120k free,   122056k buffers
Swap:  2096472k total,      104k used,  2096368k free,  5461160k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                     
20757 mysql     15   0 10.2g 9.7g 5440 S 29.0 61.6  28588:24 mysqld                                                                                                                                       
16610 root      15   0  184m  18m 4340 S  0.0  0.1   0:32.89 sysshepd                                                                                                                                     
 9394 root      15   0  154m 8336 4244 S  0.0  0.1   0:12.20 snmpd                                                                                                                                        
17481 ntp       15   0 23416 5044 3916 S  0.0  0.0   0:02.32 ntpd                                                                                                                                         
 2000 root       5 -10 12652 4464 3184 S  0.0  0.0   0:00.00 iscsid                                                                                                                                       
 8768 root      15   0 90164 3376 2644 S  0.0  0.0   0:00.01 sshd       
share|improve this question

marked as duplicate by Scott Pack, Iain, RobM, mailq, MadHatter Nov 20 '11 at 5:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2  
It's obligatory to point you to linuxatemyram.com –  Iain Nov 19 '11 at 20:26
    
Looks like it's behaving as I'd expect. The real issue here is PEBCAK. –  Tom O'Connor Nov 20 '11 at 10:06
add comment

3 Answers

The line you should be looking at is:

-/+ buffers/cache:      10504       5549

which suggests you have more than 5GB that can be freed on a 16GB machine. Alternatively, you can do math and add up the free + buffers + cache from the first line and get approximately the same number, but math is hard, so why bother if it's right there on the next line.

share|improve this answer
add comment

Yes the buffers are used by the system to speed up I/O operations (e.g., by caching file reads). If needed this memory will be automatically freed.

Your swap memory is not used which is a good sign (the system never needed more than the available physical memory).

share|improve this answer
add comment

Linux has managed to take advantage of almost all of your memory, letting very little go to waste. It's not like if you use 2GB less today, you can use an extra 2GB tomorrow.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.