-1

I remember, back from my days with Windows Vista/7, that there was a tool called memclear or memclean that would free some memory by invoking the NT garbage collection API. Probably it cleared cache too. Very often when I use Ubuntu, after a while the system stays at a couple of gigabytes allocated memory, and when I perform memory-intensive tasks such as image editing, I have to wait quite a while for the extra gigabytes to swap.

Is there a way to force something like a kernel GC to free memory that really isn't used? (when I start up, memory consumption is less than a gigabyte)

2
  • 1
    The way to free memory is to close the programs that are using it. Dropping buffers and caches (memory that "isn't used") doesn't help you. Nov 18, 2015 at 6:12
  • (Except in fairly rare cases that it doesn't sound like you're in). Nov 18, 2015 at 6:14

2 Answers 2

5

From what you have posted it doesn't seems like you under stand how memory works in Linux.

I recommend reading

The jist of those sites is that you have more "free" ram then you think.

4

If it is a virtual machine, you can do

echo 1 > /proc/sys/vm/drop_caches

This way, for instance, in vmware with memory ballooning (i.e. vmware-tools or open-vmware-tools installed), you return the current memory used in caching to the virtualisation hypervisor.

As others say, this is only useful in very specific conditions.

Not the answer you're looking for? Browse other questions tagged .