0

My buffer memory in server got increased after taking backups from multiple servers using rsync. This disk got almost full, removed the backups. As far as I understand buffers shoot up if we perform a lot of direct disk IO.

The rsync was done, but buffer memory is still not freed up after around 8 hours.

             total       used       free     shared    buffers     cached
Mem:          7.7G       6.9G       761M      2.6M       3.7G       2.1G
-/+ buffers/cache:       1.2G       6.5G
Swap:         7.9G       411M       7.5G

This is a gaming test server, which is currently running. Is it safe to clear them? How to clear buffer without clearing cache?

Also I am concerned about :: -/+ buffers/cache: 1.2G 6.5G . What is it?

prado
  • 930
  • 1
  • 11
  • 33
  • Have a look at this link ... http://unix.stackexchange.com/questions/87908/how-do-you-empty-the-buffers-and-cache-on-a-linux-system – quettabit Apr 06 '17 at 05:33

1 Answers1

2

The system will automatically flush buffers and cache from memory when a process requires more memory to work with, so you don't need to do anything.

Unused memory space is wasted space, so the kernel will load frequently used data to make it available faster.

As for the +/- buffers/cache line, it shows what is actually used and available to you and is the line you should really be paying attention to. ;)

Mio Rin
  • 3,040
  • thanks. Is there any automated process in kernel to free up buffer by itself, if it is unused or is it like it will take buffer memory only when a process requires more memory? – prado Apr 06 '17 at 05:36
  • The kernel will free it when it sees the need to free it up for something. – Mio Rin Apr 06 '17 at 05:41
  • So the process is suppose to take memory from swap once the actual RAM is completed, ie the used in the second line also needs to be 7.7G right? If so why swap is used here? – prado Apr 06 '17 at 09:47
  • The system will start putting stuff in swap when a certain level of memory usage is reached to ease the 'pressure' on the RAM. That level is set at startup and can vary between distributions. (Do a search for 'swap pressure linux' to learn more) If you had no swap, the kernel would start to randomly kill off processes to try to free up memory instead (that's a Bad Thing). – Mio Rin Apr 06 '17 at 09:57