posted by Thom Holwerda on Mon 11th May 2009 20:43 UTC
IconSuperFetch is a technology in Windows Vista and onwards that is often misunderstood. I decided to delve into this technology to see what it is all about, and to dispel some of the myths surrounding this feature.

Very succinctly put, SuperFetch is a technology which allows Windows to manage the amount of random access memory in the machine it runs on more efficiently. SuperFetch is part of Windows' memory manager; a less capable version, called PreFetcher, is included in Windows XP. SuperFetch tries to make sure often-accessed data can be read from the fast RAM instead of the slow hard drive.


SuperFetch' goals

SuperFetch has two goals: it decreases boot time, and makes sure applications that you use the most load more efficiently. SuperFetch also takes timing into account, in that it will adapt itself to your usage patterns.

Let's focus on decreasing boot times first. During the Windows boot process, the same files need to be accessed at different times. SuperFetch records which data and files need to be accessed at which times, and stores this data in a trace file. During subsequent boots, this information is used to make the loading of said data/files more efficient, resulting in shorter boot times.

SuperFetch performs more tasks to make the boot process more efficient. It also interacts with the defragmenter to make sure that the files accessed during the boot process are stored on the disk in the order they are accessed in. It performs this as a routine task every three days; the specific file layout is stored in /Windows/Prefetch/Layout.ini.

SuperFetch' second goal is to make applications launch faster. SuperFetch does this by pre-loading your most often used applications in your main memory, based on not only usage patterns, but also on when you use them. For instance, if you have the same routine every morning (Chrome - Mail - Miranda - blu), SuperFetch will pre-load these into memory in the morning. If your evening routine is different (for instance, it includes Word, Excel, and Super Awesome Garden Designer), SuperFetch will adapt, and load those in memory instead during the evening.

SuperFetch for applications basically operates in the same way as the boot variant; it traces what files are accessed by an application during the first ten seconds of said application's startup, which can then be used to load the proper data in memory at appropriate times. SuperFetch data for applications is stored in /Windows/Prefetch (the various .pf files).

Windows has always included a built-in caching mechanism, but this one is quite limited. All it basically does is keep application data in memory after its termination, which allows applications to be loaded faster right after quitting them. This caching mechanism is helpful, but limited - for instance, a reboot obviously flushes all data in RAM. In addition, cached data will eventually drop out of RAM if other applications push it out of RAM.

SuperFetch also has other advantages, Mark Russinovich details some of them.


SuperFetch myths

There are a lot of myths going around about SuperFetch, the most predominant probably having to do with how Task Manager reports memory statistics. If you open Task Manager (in Windows 7), it'll tell you Total, Cached, Available, and Free. The problems arise from the "Cached" figure, since this figure is generally substantially higher than the "Free" figure.

When people look at the Task Manager, and they see the figure for "Cached" compared to the number of "Free", people assume that only very little of their memory is available for the applications they are about to launch. What they forget is that the Cache filled by SuperFetch and the standard caching mechanism runs on a lower priority; in other words, memory requests by applications will always supersede SuperFetch.

In other words, whatever you see in the "Cached" figure is actually accessible to applications.

And this brings us to the question of what to do with RAM. I have 4GB of main memory in my main desktop machine, and I would find it a total waste if the operating system did not use it to make my computing experience smoother. Isn't that why I got 4GB of top-quality RAM in the first place? To make my machine faster?

This is exactly what SuperFetch does. It's an intelligent mechanism that uses the RAM in a machine to its fullest potential to make computing a smoother experience. The fact that SuperFetch (and its related technology, ReadyBoost) actually works, has already been confirmed by Tom's Hardware. The key here is that the more RAM you have, the bigger the benefit SuperFetch delivers; according to Tom's Hardware, Vista's sweet spot was about 2GB of RAM, but even at 1GB they noticed a positive difference.

Contrary to what many Windows tweaking guides on the internet tell you, SuperFetch does not impact your every day computing experience in a negative way. SuperFetch makes often-used applications load fast - it doesn't make other applications load any slower. As such, turning it off, as some guides advise you to do, can only result in a slowdown, not a speed up.

Another oft-made claim is that SuperFetch will make your boot times considerably longer, and that any advantages in application launch times are nullified by an increase in boot times. Not only is this very debatable (since SuperFetch also works for booting the operating system), you also have to ask yourself: what action do I perform more often, booting, or launching applications?

Even if there was a trade-off, it's probably a worthwhile one. Reducing application load times will have a more positive impact at the end of the day than reducing boot times would.


Conclusion

SuperFetch is something all operating systems should have. I didn't buy 4GB of top-notch RAM just to have it sit there doing nothing during times of low memory requirements. SuperFetch makes my applications load faster, which is really important to me - I come from a BeOS world, and I like it when my applications load instantly.

SuperFetch' design makes sure that it does not impact the system negatively, but only makes the system smoother. Because it runs at a low-priority, its cache doesn't take away memory from the applications you're running.

e p (3)    79 Comment(s)

Technology White Papers

See More