SuperFetch: Performance Enhancing Features in Windows Vista
Windows vista has number of memory management improvements including extensive use of lock-free synchronization techniques, finer-grained locking, tighter data-structure packing, larger paging I/Os, support for modern GPU memory architectures, and more efficient use of the hardware Translation Lookaside Buffer. Windows Vista also offers dynamic address space allocation for different workloads. Windows Vista also has four performance enhancing features SuperFetch, ReadyBoost, ReadyBoot, and ReadyDrive. Instead of discussing all of them in one post I will discuss each feature in a separate post. In this post I am discussing SuperFetch.
SuperFetch
Previous version of windows uses Standby List Management for managing physical memory. Standby List management has two limitations
-
For prioritization of pages relies on the past activities of processes and there is no mechanism for anticipating the future requirement of memory pages.
-
Data used by windows for prioritizing pages is only depends on the pages owned by the processes.
These two shortcomings can result in “after lunch syndrome” when computer is ideal for some time then some memory intensive processes may start running. Memory intensive processes can be antivirus scan or disk defragmentation processes. These processes overwrite their data to active processes cached data and code. When you again start working on the computer system you get the sluggish performance.
SuperFetch is implemented in %SystemRoot%\System32\Sysmain.dll as a Windows service that runs inside a Service Host process (%SystemRoot%\System32\Svchost.exe). SuperFetch relies on support from the Memory Manager. So now operating system can get the page usage history as well as Memory Manager can preload data and code from files on disk or from a paging file into the Standby List and assign priorities to pages. The SuperFetch service essentially extends page-tracking to data and code that was once in memory, but that the Memory Manager has reused to make room for new data and code. It stores this information in scenario files with a .db extension in the %SystemRoot%\Prefetch directory alongside standard prefetch files used to optimize application launch. Using this deep knowledge of memory usage, SuperFetch can preload data and code when physical memory becomes available.

Whenever any process exists or releases the memory, SuperFetch asks the Memory Manager to fetch data and code that was recently evicted. This is done at a rate of a few pages per second with Very Low priority I/Os so that the preloading does not impact the user or other active applications. SuperFetch also includes specific scenario support for hibernation, standby, Fast User Switching (FUS), and application launch. When the system hibernates, for example, SuperFetch stores data and code in the hibernation file that it expects (based on previous hibernations) will be accessed during the subsequent resume. In contrast, when you resume Windows XP, previously cached data must be reread from the disk when it is referenced.


Leave a Reply