Shutdown: Clear Virtual Memory Pagefile in Windows 8

Clear the Virtual Memory Pagefile when Windows 8 Shuts Down

The problem: Windows 8 takes ages to shut down. 
Solution 1 – Group Policy Editor: Clear virtual memory pagefile.
Solution 2 – Regedit: ClearPageFileAtShutdown.

Windows 8 Shutdown Clear Virtual Memory Pagefile

 ♦

How to Clear the Virtual Memory PagefileGroup Policy Security Options

Scenario: You wish to check the group policy setting that controls the Windows 8 pagefile.  To get started search for Gpedit.msc, please remember the extension .msc.

Navigate inside the Group Policy Editor as follows:

  • Computer Configuration
  • Windows Settings
  • Security Settings
  • Local Policies
  • Security Options
  • Scroll down to Shutdown:

Shutdown: Clear Virtual Memory Pagefile
Make sure it's set to: Enabled.

See screenshot below:

Group Policy Shutdown Clear Memory

Clear Virtual Memory Pagefile
The default option for this policy is Disabled.  When you enable this security setting it causes the system pagefile to be cleared when the computer is shutdown cleanly.  Incidentally, if you enable this group policy, the hibernation file (hiberfil.sys) will also be zeroed whenever hibernation is disabled.

Guy Recommends:  A Free Trial of the Network Performance Monitor (NPM)Review of Orion NPM v11.5 v11.5

SolarWinds’ Orion performance monitor will help you discover what’s happening on your network.  This utility will also guide you through troubleshooting; the dashboard will indicate whether the root cause is a broken link, faulty equipment or resource overload.

What I like best is the way NPM suggests solutions to network problems.  Its also has the ability to monitor the health of individual VMware virtual machines.  If you are interested in troubleshooting, and creating network maps, then I recommend that you try NPM now.

Download a free trial of Solarwinds’ Network Performance Monitor

Change ClearPageFileAtShutdown in the Registry of Windows 8

Launch regedit and navigate as follows:

  • HKEY_LOCAL_MACHINE
  • System
  • CurrentControlSet
  • Control
  • Session Manager
  • Memory Management

Double-click the ClearPageFileAtShutdown and set its value to 1.

1 = Empty the pagefile at Shutdown.
0 = Leave the pagefile as it is.

Group Policy Shutdown Clear Page File At Shutdown

Tip: View the Group Policy setting and the registry DWORD together, that way you can double-check the logic, read the help files – and have fun!

Tip: If you like ClearPageFileAtShutdown, or any other registry setting, click Favorites (Menu) and 'Add to Favorites'.

More Information About Windows 8 Pagefile

Dual-booting would be a good reason to clear the pagefile.Virtual memory support uses a system pagefile to swap pages of memory to disk when they are not used.

On a Windows 8 system, this pagefile is opened exclusively by the operating system. However, with a dual-booting machine you might want to make sure that the system pagefile is wiped clean when Windows 8 shuts down. This ensures that sensitive information from process memory that might go into the pagefile is not available to an unauthorized user who manages to directly access the pagefile.

Guy Recommends 3 Free Active Directory ToolsDownload Solarwinds Active Directory Administration Tool

SolarWinds have produced three Active Directory add-ons.  These free utilities have been approved by Microsoft, and will help to manage your domain by:

  1. Seeking and zapping unwanted user accounts.
  2. Finding inactive computers.
  3. Bulk-importing new users.  Give this AD utility a try, it’s free!

Download your FREE Active Directory administration tools.

Troubleshooting Windows 8 Group Policies

Use a Spare Laptop for Testing
I prefer to experiment with Gpedit.msc on a Windows 8 laptop rather than use a domain controller.

Get a Simple Policy Working 
If nothing seems to be happening, then try a simple group policy before researching unfamiliar settings.  Incidentally, it always amazes how once I get one policy working it seems easier to get other more tricky settings to do what I ask of them.

Read the Policy Carefully
Be careful with double negatives in group policies, for instance, ‘Enable…. Clear Page file. Means the pagefile is set to as zero bytes.  Disable… Clear page file means nothing happens.  Check your logic with a quick look at the description of a policy you are about to apply.  See more on Microsoft’s Group Policies.Windows 8 Shutdown command

Experimenting with  Microsoft’s Windows 8 Shutdown Command

The rest of this page explains how to fine-tune the shutdown command by appending a variety of switches.

There are two ways of executing the pure shutdown command in Windows 8.  The traditional method is from inside cmd.exe, alternatively, you can launch a GUI by typing Shutdown -i. 

As you can see from the GUI screenshot to the right, you can also restart the machine.

Windows 8 Swapfile

In addition to a file called: pagefile.sys, Windows 8 also has a physical file called swapfile.sys.  I haven't seen a swapfile since WIN386.SWP in Windows 95, but Microsoft has resurrected it here in Windows 8.

The Windows 8 swapfile is usually 256 MB (the pagefile is usually much bigger) and is there mainly to support Metro apps .  The idea is for the operating system to use the swapfile for paging recent data, and thus is a useful feature for machines with relatively little RAM.

Summary of Shutdown: Clear Virtual Memory Pagefile

If you are faced with a problem of Windows 8 taking an inordinately long time to shut down, then it could be a problem with the pagefile.  There are two methods to check and configure the settings, use the Group Policy editor, or launch Regedit and find ClearPageFileAtShutdown.

If you like this page then please share it with your friends

 


Microsoft Windows 8 Group Policy Topics

Windows 8 Gpedit.msc  • Windows 8 Group Policy Editor  • Windows 8 Group Policy Firewall

Windows 8 Group Policy Preferences  • Windows 8 Remote Desktop Group Policy

Windows 8 Config  • Windows 8 Family Safety  • Windows 8 Event Viewer  • No Auto Restart