How to Clean Up Pagefile.Sys

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.

Step

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

Step

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

Step

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.

Step

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.

Step

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

Step

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

Step

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.