Hello AskPerf! Welcome to day 7 of our Launch Series. Today we are going to talk about the new Swapfile introduced in Windows 8. You may ask, “Why do we need another virtual page file?” Well, with the introduction of the Modern App, we needed a way to manage their memory outside of the traditional Virtual Memory/Pagefile method. With that, the “%SystemDrive%\swapfile.sys” was born. To view this file (hidden by default), you can go to View | Options | Change folder and search options | View tab. In the Advanced settings section, scroll down and uncheck “Hide protected operating system files”, then click Apply, OK.
Swapfile.sys on the %SystemDrive%
Swapfile.sys and it’s interaction with the Memory Manager
Windows 8 can efficiently write the whole (private) working set of a suspended Modern app to disk in order to gain additional memory when the system detects pressure. This process is analogous to hibernating a specific app, and then resuming it when the user switches back to the app. In this case, Windows 8 takes advantage of the suspend/resume mechanism of Modern apps to empty or re-populate an app’s working set.
The sequence of events is described below:
1. The Process Lifetime Manager (PLM) detects memory pressure in the system and asks the Memory Manager (MM) to empty the working set of a specific process that houses a suspended Modern style app.
2. MM moves the pages of memory from the working set of the app to the operating system’s modified page list (which is a list of memory whose contents are to be written out to disk before being reused).
3. The working set pages on the modified page list are written out asynchronously, as dictated by the usual MM policies (written out opportunistically in the background, writes triggered when under memory pressure).
4. Even after the suspended app's working set is written to disk, the memory pages removed from a process are left intact on the operating system’s standby list. This is a cache of useful pages of memory that can be repurposed for other apps, if necessary. If these pages are immediately needed again by their original process, they are quickly moved back.
If a user switches back to the app while its working set pages are still in physical memory (on the modified page list or the standby list), the pages will be added back into the app’s process immediately. If they are no longer available, Windows will read in the app’s working set from disk in an optimized manner.
With that, this concludes this post. Tomorrow we will be going over the new Windows To Go option. Have a great Day!
-AskPerf blog Team
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.