Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using ubuntu 10.10. My RAM is 3GB and swap memory is 2GB. After using my system for several hours, all of my swap memory is used up. Is there any way so I can clean up swap memory?

share|improve this question
    
Is there a specific problem this is causing, or do you just hate the numbers? –  Ignacio Vazquez-Abrams Apr 17 '11 at 2:31
    
@abrams: my cpu usage goes to 100% frequently. i don't know what is the cause. so i am checking out everything to narrow the options –  user Apr 17 '11 at 2:35
3  
That would not be caused by the swap. –  Ignacio Vazquez-Abrams Apr 17 '11 at 2:39
add comment

2 Answers

up vote 4 down vote accepted

You could literally do this with the following:

swapoff /dev/sda2
swapon /dev/sda2

(assuming that /dev/sda2 is the location of your swap partition).

Not sure what the effect would be on system performance though while all swapped pages are moved back into physical RAM.

share|improve this answer
add comment

I'd recommend trying to track down what is using all the swap space...

Run top then press OoReturn (that's capital-o, lowercase-o)

That will order the listing by the amount of virtual memory space the processes are using. You can then see what it is that is consuming all your swap.

share|improve this answer
    
This is great. I often have problems of putting Ubuntu to hibernate, because the swap space is too loaded. Using this, I was able to track down the process, killed it and everythings works now. Thank you. –  mpaepper Jan 16 '13 at 19:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.