Windows tip: How to clear the Pagefile on Shutdown

By Detector | 24 November 2008



A pagefile or swap file is a reserved portion of a hard disk that is used as an extension of random access memory (RAM) for data in RAM that hasn’t been used recently. A pagefile can be read from the hard disk. Clearing page file can be very useful if you need more space on your Hard Drive. Here is two solutions to set the computer to clear the pagefile:

Clearing page file without directly editing the registry:

  1. Click on the Start button
  2. Go to the Control Panel
  3. Administrative Tools
  4. Local Security Policy
  5. Local Policies
  6. Click on Security Options
  7. Right hand menu – right click on “Shutdown: Clear Virtual Memory Pagefile”
  8. Select “Enable”
  9. Reboot

Clear the page file on each shutdown (edit in registry):

  1. Start Regedit
  2. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
    \Session Manager\Memory Management\ClearPageFileAtShutdown
  3. Set the value to 1

Tags | , , ,

| |

3 Responses to “Windows tip: How to clear the Pagefile on Shutdown”

  1. lmiller7 says:

    The author is confused about what this setting does. It does NOT delete the pagefile but overwrites it with zero’s. This can add considerably to restart and shutdown times. Even if the pagefile was deleted on shutdown it would be recreated on bootup with no less space used.

    This setting is sometimes used as a security measure. But this really only makes sense as part of a comprehensive security policy. The risks of not doing this are very small and there are many things that are more important.

    There are NO performance benefits in clearing the pagefile.

    Larry Miller
    Microsoft MCSA

  2. Mike says:

    Is there a way to empty the paging file without having to restart? It always pops that “Low on virtual memory” bubble up right when I’m in the middle of something. So, I have to stop and restart. Really annoying.

  3. lmiller7 says:

    There is no way the pagefile can be cleared while Windows is running. If you receive the warning above you should increase the initial size of the page file. Set the maximum to at least twice this value. An even better idea would be to add more RAM if possible.






Archives

Add to Technorati Favorites
website stats
TwitterCounter for @ukion