I'm having a strange problem with a new clean install of Ubuntu 12.10, any disk operations I do, like restoring a backup eats all my 8gb of ram, and it doesn't seen to release the memory, so I'm using swap.

It looks like a memory leak, but I don't know if I'm right.

I don't know where to begin for diagnose this things.

Details: I don't have any applications open, except my backup being restored by ubuntu's backup application (duplicity). I'm monitoring the memory utilization by htop and free. I know there's a lot of cached memory, but the system becomes slow and I'm using swap, so I think the kernel or whatever it is causing this problem is not freeing cache when requested.

  • How exactly did you find out that disk operations consume all your memory? Do you know that Linux is using all available RAM for I/O caching purposes? This kind of consumption doen't really use up available RAM space, this space is immediately released when an application requests it. See this post for details of how to manually free this part of memory. – bender Jan 16 '13 at 0:26
  • I'm monitoring with htop and I don't have any programs open, only my backup restoring (through default backup application duplicity). The top consuming ram application is using 30mb of resident memory. – loop0.brs Jan 16 '13 at 0:29
  • You will have to be more specific. – psusi Jan 16 '13 at 5:19
  • The problem is: why am I using swap if I have 8gb of ram and no application open? (except backup restoring) Using a fresh install (updated) of ubuntu 12.10. It look like a bug to me. – loop0.brs Jan 16 '13 at 11:59

You can try to run these commands from Terminal:

sudo -s
echo 3 > /proc/sys/vm/drop_caches  

I have used it as well, and my "used mem" in top is ~ 1G again!


I had a similar situation.

It seems that once Ubuntu starts using swap, it doesn't release RAM easily even after the operation is finished.

I found a solution by running two commands after the RAM intensive operation is over. That is: sudo swapoff -a followed by sudo swapon -a. This disables swap during which anything in swap is transferred in RAM and re-enables it.

I would suggest you try to do the restore gradually if possible. Give more details in your question for specific help with this.


Well my problem is resolved by using a newer kernel, I'm using kernel 3.8 and do not have this problem now.

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.