Results 1 to 10 of 10

Thread: How to clear SWAP memory

  1. #1
    Join Date
    Apr 2008
    Beans
    382

    How to clear SWAP memory

    Before I fire up VirtualBox (to use XP), my SWAP partition was empty. During XP session, it was 300-400Mb while RAM was around 900Mb (out of 1GB). This is understandable since VirtualBox requires a lot of memory and I also set XP virtual memory to 512 Mb. However, after closing XP and VirtualBox subsequently, there is still some 'residue' memory in SWAP (about 200 Mb). I have to log out to clear this memory but there is still about 52 Mb in it. How do I clear SWAP after using VirtualBox without log out or restart system?

  2. #2

    Re: How to clear SWAP memory

    Im afraid i cant be of help to you.

    But can you possibly outline how you set your windows virtual
    memory to 512MB?

    Thanks!

  3. #3
    Join Date
    May 2007
    Location
    The New Forest
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: How to clear SWAP memory

    Why are you trying to clear your swap? It's not necessary - it will clear itself as required.

    Is it causing you a problem.

  4. #4
    Join Date
    May 2007
    Location
    The New Forest
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: How to clear SWAP memory

    Quote Originally Posted by 4-Ever-Euphemistic View Post
    Im afraid i cant be of help to you.

    But can you possibly outline how you set your windows virtual
    memory to 512MB?

    Thanks!
    If you must put questions regarding window sin here do so in athread of your won in the windows forum. As it is right click your my computer - use advanced and performance tab I think and set it there.

  5. #5
    Join Date
    Jun 2006
    Location
    Solihull, UK
    Beans
    1,413

    Re: How to clear SWAP memory

    If you want everything that has been swapped out to be placedback in to physical RAM, then the quickest way is to do:
    Code:
    sudo swapoff -a
    sudo swapon -a
    Turning the swap off will automatically move all swapped pages back in to physical RAM (if you've got enough of it)

  6. #6

    Re: How to clear SWAP memory

    Quote Originally Posted by forestpixie View Post
    If you must put questions regarding window sin here do so in athread of your won in the windows forum. As it is right click your my computer - use advanced and performance tab I think and set it there.
    Fair enough.I thought it would be handy to quickly ask
    rather create a whole new thread.

    But point noted!

  7. #7
    Join Date
    Jun 2011
    Location
    India
    Beans
    2
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: How to clear SWAP memory

    I have a similar problem and don't have the root access as well.
    So I guess I can't use the suggested method.
    I do some memory taking simulations which fill the memory. Later the memory becomes free and still a lot of swap stays filled. When I need to analyse the simulations, I have to logout-login oterwise the system slows down.
    So is there some other method to clear the swap?

  8. #8
    Join Date
    May 2007
    Location
    Leeds, UK
    Beans
    1,664
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How to clear SWAP memory

    When you have an extremely memory hungry program it bumps everything else into swap. When the memory hungry program stops, things you want to use have to come back out of swap and into memory. So you experience some initial slowdown. It shouldn't last.

    The swapoff/swapon method just forces everything back into memory in one go. It's not an instant thing. There will be lots of disk churning and a delay while things are recovered from swap.

  9. #9
    Join Date
    Mar 2008
    Location
    Flemington, New Jersey
    Beans
    25
    Distro
    Kubuntu

    Re: How to clear SWAP memory

    Quote Originally Posted by chrisccoulson View Post
    If you want everything that has been swapped out to be placedback in to physical RAM, then the quickest way is to do:
    Code:
    sudo swapoff -a
    sudo swapon -a
    Turning the swap off will automatically move all swapped pages back in to physical RAM (if you've got enough of it)
    This is Gold!

  10. #10
    Join Date
    May 2007
    Location
    The New Forest
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: How to clear SWAP memory

    Old thread closed.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •