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

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232

2 Answers2

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.

coteyr
  • 4,310
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.

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232