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?

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. ;)

  • 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 6 '17 at 5:36
  • The kernel will free it when it sees the need to free it up for something. – Mioriin Apr 6 '17 at 5: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 6 '17 at 9: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). – Mioriin Apr 6 '17 at 9:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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