Windows MemoryApplications needs memory and will ask Windows to provide this. Windows can get memory from the quick RAM or from the slow disk. When there is not enough quick RAM to run a new application, then Windows will attempt to free RAM by paging other running applications to the pagefile on the slow disk.
Windows constantly trims the working memory of the running applications, and puts less frequently used memory-pages on a standby-list. Slowly the memory-pages in the standby-list are paged out to the disk, but the memory pages are still kept in RAM. This allows Windows to quickly give the RAM to a new application when needed, but also allows the running application to reference the memory-page without going to disk.
When application has been standby for a long time, then it will take a long time to activate the application again. The application will slowly load itself into memory, because each memory-page access will give a pagefault:
- Hard Page Fault - The application memory-page has been paged to disk, and now it has to be loaded from disk. This is a blocking operation and will hurt application performance.
- Soft Page Fault - The application memory-page resides in the standby-list, and can be quickly loaded back into the application working set.
- Soft Page faults also happens when the application allocates new memory-pages, by taking them from the free-list / standby-list.
More Info The Basics of Page Faults
Windows XP PrefetchWindows can monitor what files an application uses at startup, and next time the application starts then automatically load these files into the file cache. Application startup will then be faster. Logical Prefetcher
Windows Vista SuperfetchWindows can monitor what application you frequently use, and ensure the file cache has preloaded the application files. Application startup will then be faster. More memory is then used for disk caching, unless a running application needs it. Windows will also prioritize that frequently used applications are the last ones to be paged to disk. Superfetch
Windows 8 SwapWindows can optimize the paging of mobile application that supports suspend-/resume-state. Instead of writing separate memory pages of only 4 KByte, then will pre-allocate memory in the pagefile that fits the entire application, so it can be written to pagefile in one big disk write. This will also make it faster for the application to be paged back from the disk.
Windows 10 Compressed StoreWindows can optimize the usage of the quick RAM, by paging the application memory to a compression store instead of directly to the paging file. The compression store resides in memory of the standard system-process. Special store has been made for mobile applications that supports suspend-/resume-state, that allows them to swap into compressed state, and if needed also swap the (now smaller) compressed memory to the pagefile.
When trimming the working memory of an application, then instead of writing to disk, then they are kept in the compression store. Unless memory pressure requires them to be written to disk. This will minimize disk usage and avoids the disk from being worn out.