How to Clean Up Pagefile.Sys

Written by c. taylor
  • Share
  • Tweet
  • Share
  • Email

Windows' pagefile.sys functions as virtual memory, which allows your computer to swap information between system memory and your hard drive. Pagefile.sys doesn't need to be cleaned up to continue proper function, but it can present a security risk. Information stored in pagefile.sys can persist after rebooting your machine and may be available to knowledgeable investigators. To prevent this security breach, you can configure Windows to clear pagefile.sys when you shut down your computer. Although this heightens your security, it can also noticeably increase the shutdown time.

Skill level:
Moderately Easy


  1. 1

    Hold the Windows key on your keyboard and press "R" to open the "Run" dialogue box.

  2. 2

    Type "regedit" and press "Enter." If you see a security confirmation window, click "Yes."

  3. 3

    Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" in the Registry Editor. Do this by double-clicking through the folders in the left pane.

  4. 4

    Double click "ClearPageFileAtShutdown" from the right-hand pane. If you do not see this entry, right-click "Memory Management" from the left pane, point to "New" and select "DWORD (32-bit) Value." Type "ClearPageFileAtShutdown" and press "Enter" to create the entry.

  5. 5

    Enter "0" in the "Value Data" field and click "OK."

  6. 6

    Click the "X" at the top right of the Registry Editor to close it.

  7. 7

    Reboot your computer twice to clear pagefile.sys. The first reboot enables the clearing function you just configured. The second reboot actually clears pagefile.sys.

Tips and warnings

  • If you later decide you do not want to clear pagefile.sys during every shutdown, change "ClearPageFileAtShutdown" back to "0" and reboot your computer.
  • Always back up your registry before making any changes, as errors in the registry can have serious consequences for your computer.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.