Ubuntu – command that frees up RAM

consoleram

I was wondering if there is a command that frees up cached RAM

I often have 1GB cached RAM when I only have 1.7GB of RAM, and when I start an application like Minecraft (uses a lot of RAM) and the computer starts using 500MB of swap instead and becomes very very slow.

That's why I want to free up RAM before I start any games/apps.

Best Answer

Cached RAM? Not really, but that's RAM managed by the kernel to cache disk reads, so it shouldn't impact your system's performance, in fact it should help it. You can change the way the kernel caches things, but I don't think you can explicitly free RAM that's currently used as a page cache. Generally newer kernels try to use as much free RAM as possible as a cache and free and re-allocate it as you start new processes, so you're generally going to see quite a lot cached. Why do you want to free it?

Related Question