0

I know Ubuntu manages memory autocratically, it stores cache on ram for quick program access, but every time I fill up the cache, it stays filled up, and Ubuntu it self cant delete the cache, if I open a program, the computer will slow down extremely. I have 16gb ram, I can use "sync && echo 3 | sudo tee /proc/sys/vm/drop_caches" to clear the cache, but only until its not filled up or I wont be able to open a terminal. This has happened from 12.04 to 13.10 with the same laptop, didnt happen with the previous laptop with the 12.04. How does Linux manage the in cache memory, how does he know when to delete? i have no idea how to fix this issue..

fpinto
  • 96

1 Answers1

1

There is no need to manage, monitor or clear the Linux cache manually during normal operations, and no performance benefit in doing so.

The purpose of the cache is to store recently-accessed data from disk so that subsequent attempts to read it complete more quickly. This is why loading a large document is typically much faster the second time around. However, the memory is still considered "free" by Linux and can be re-used instantaneously if there is a need for more memory (e.g. you load a new program or document), so clearing the cache does not achieve anything. The drop_caches control is there to help developers with benchmarking and testing, not for ordinary users.

It is not possible to say what is causing your slow program loading without more information, but it almost certainly has nothing to do with the cache. Poor disk performance or the presence of other disk or CPU-intensive processes are possible culprits.