Tip of the day: Don’t clean out the Prefetch folder

At least once a week I run across some well-meaning soul who passes along a dubious tip designed to enhance the performance of Windows XP. According to these folks, you should clean out the Windows Prefetch folder regularly to improve your system’s performance. They’re wrong, because they don’t understand how this feature works. Even generally reliable sources like Fred Langa can get tripped up. Here’s what you need to know:

The Prefetch folder is not a cache – at least not in the sense that you normally think of when you use that term. This folder contains trace files and layout files that Windows uses in specific circumstances. Trace files describe the exact order in which segments of programs (executable files and dynamic link libraries, including those that make up Windows itself) load. Windows uses this information to launch Windows and Windows programs in the most efficient way possible. Layout files provide a list of files and directories in the order that they are accessed when you start your computer or run a program. The Windows XP Defrag program uses the layout information to arrange these files in a contiguous region of the hard drive. The “prefetching” doesn’t mean that code is being loaded unnecessarily; it means that code is being loaded in the right way, and only when it’s needed.

Cleaning out the Prefetch folder will not improve performance. I have proved this with a stopwatch repeatedly on multiple test systems, and documented the results in Windows XP Inside Out Second Edition. In fact, emptying the Prefetch folder will actually reduce performance, because Windows has to re-create the trace files the next time you run the program. Windows cleans out old files here automatically, and it uses the current information simply as instructions to help load programs more efficiently. If you delete a program, its layout and trace files go unused and are deleted within weeks.

This isn’t the first time I’ve written about the Prefetch folder. I have a detailed write-up on the subject here. Be sure to follow the links to the excellent article by Mark Russinovitch and David Solomon and scroll down to the section entitled Prefetch, which explains how this feature works in very clear detail.

The next time someone tells you that cleaning out the Prefetch folder is a performance-enhancing measure, tell them it just isn’t so.

36 Thoughts on “Tip of the day: Don’t clean out the Prefetch folder

  1. Laurent on April 12, 2005 at 10:06 am said:

    What do you think about adding /prefetch:1 to shortcuts? Does it make any difference? I’ve read on several forums to use the switch for quicker application launches but I haven’t really noticed any increase in speed.

  2. Not only does prefetching on XP provide a performance boost, but it also greatly enhances the forensics opportunities presented by the system.

    H. Carvey
    “Windows Forensics and Incident Recovery”
    http://windowsir.blogspot.com

  3. Ion Control on February 3, 2006 at 10:22 am said:

    Cleaning out the prefetch folder IS a valid performance boost. The prefetch folder, afaik, is limited in size. When you install a new systm, every program run is examined for the prefetch folder. As the folder fills, you begin to accumulate prefetch information for programs you may no longer use. Deleting the folder forces Windows to rebuild, providing a boost by building prefetch data for newer programs and removing older ones. It will not make regularly-used programs run faster unless it’s a program that was kept out of the folder due to size limitations…

  4. Ion, your facts are incorrect.

    The Prefetch folder is limited in size to 128 entries. It cleans itself.

  5. Oron Dhaleigh on May 27, 2006 at 6:19 am said:

    I have a heavy spyware/adware problem. It is a spyprotection program that is sitting ont he computer and lets adware and spyware get on the computer (i suspect) and by so intends to force purchace. We put a new antyvirus on the computer, and it did get the viruses and the spy and adwares off, but it isnt able to find the program that starts it all. I was wondering if that program can be lodged in the prefetch?
    also, any suggestions will be greatly apresiated…
    thank you

  6. C.Crowe on June 4, 2006 at 6:07 pm said:

    My Adaware freezes when it hits the Prefetch folder. Why is that? Is there anything I can do about it?

  7. I added this to my XP Myths article because I was tired of the Malware/Spyware Prefetch nonsense:

    http://mywebpages.comcast.net/SupportCD/XPMyths.html

    Malware/Viruses – Some people irresponsibly recommend cleaning this folder due to possible Malware/Virus infection. Malware/Viruses can place an infected file(s) in any folder and the Prefetch folder is no different. Do these same people recommend deleting the contents of the Windows folder because it is a popular location to find an infected file(s)? Of course not, you simply clean or delete the infected file(s) not the contents of the folder. This Myth got started due to the indiscriminate nature of the Windows Prefetcher, which will Prefetch any executable file that you load or loads during Windows start up. Thus it is quite common on an infected machine to find a Prefetch (.PF) trace file in the Prefetch folder with the same name as an infected executable. These files are NOT Malware/Viruses. They are there to improve the load time, in this case ironically, of the Malware/Virus but do not contain any infected code. Once the associated infected executable is deleted, these Prefetch (.PF) trace files do nothing and will eventually automatically be cleaned by Windows.

    C. Crowe – There can be many reasons why it is “freezing” at that folder. I would suggest running adaware in safe mode. This is recommended to remove complex spyware anyway.

  8. Crog on June 30, 2006 at 4:40 pm said:

    Then how does one get keep programs from installing automatically with Windows? Programs such as Roxio and iTunes that load up into the tray and use RAM. ??

  9. thank you for your energy

  10. Crog,

    Those programs are not “installing” automatically, they are LOADING automatically. If you want to disable those from loading use this tool:

    http://www.sysinternals.com/Utilities/Autoruns.html

    What you are refering to has NOTHING to do with prefetching.

  11. I am curious if one has multiple exe’s of a particular app running in this folder, why is that the case?
    If there are muliple instances of the same EXE, this seems to degrade performance rtelated to these apps. Is this an issue with the way the specific app is loading, regarding the trace files?
    Most apps or process look to have one instance, thus my question about when one sees say, 15 instances of the same apps. exe in the c:\Windows\prefetch\ folder. This seems to be bad. It seems that one instance is what is needed for a given process/EXE.
    Let me know what you think at your leisure,
    Regards,
    -Fred

  12. Windows Prefetching will only create one .PF trace file per application. These will all have the same .PF extension. They will look like this:

    FIREFOX.EXE-XXXXXXXX.pf
    NTOSBOOT-B00DFAAD.PF

    The only other file with a different extension should be the:
    Layout.ini

    Any file in their with a .exe extension is not a Prefetch Trace file. Please post the file names of what you are talking about. Also these files are not “running” in this folder. They are REFERENCED when the application with the equivalent name’s load is first initiated for a session.

  13. No one answered Laurent’s question,
    “What do you think about adding /prefetch:1 to shortcuts? Does it make any difference? I’ve read on several forums to use the switch for quicker application launches but I haven’t really noticed any increase in speed.”

    I have the same question and one more. Does adding /prefetch:1 to programs in the registry help as well? I have been told to add it to explorer.exe because it makes windows run faster.

  14. The “/prefetch:1″ switch is a myth. See the full explanation here.

  15. No, no performance gain from using /prefetch: yourself.

    /prefetch switch information: http://www.edbott.com/weblog/archives/000621.html

  16. Ed,

    One of the reasons your Prefetching articles are getting so much attention lately is this ridiculous post on Digg that now has over 4000 Diggs as mobs of mindless Digg Users slow down their systems:

    http://digg.com/software/Why_windows_takes_so_long_to_start_up

  17. Cleaning the prefetch folder occasionally is warranted and needed.

    I recently had a problem with a program which caused it to crash, and then I couldn’t get it to run again. I couldn’t figure out what was going on until I remembered the info I had run across with the prefetch folder. So I deleted the entry which seemed to correspond with my offending program. I immediately ran the program again, and now it ran perfectly.

    I also had some users which were having odd problems with programs which utilized windows ftp services, constantly dropping connections, connections not working anymore, etc.. I thought I’d check the prefetch folder to see if it was prefetching http://ftp.exe, it was, I deleted the ftp prefetch entries and the program started working correctly.

    I’m not disputing your information, I agree that the prefetch DOES increase performance, and turning it off is just silly. However, windows being windows, when incorrect information is recorded in the prefetch, that information is used regardless, and windows doesn’t clean out the incorrect information if it’s a program you use on a regular basis. Thus, it would be wise to clean out the prefetch folder occasionally, I’ve set up to do it once a month.

    Just my .02 to add some balance.

  18. No it is not “wise” to clean the folder out occassionally or ever. What you are describing is a corrupt prefetch file which is not common. I’ve seen problems like this on systems that are oveclocked, not using NTFS for the file system, have defective memory or other defective hardware. You need to fix whatever is corrupting your files. This should be rare to non existent with NTFS regardless.

    But the problem is YOUR SYSTEM not Prefetching.

  19. Tom Morgan on March 1, 2007 at 3:38 pm said:

    Does anyone know about the .exe file ‘curb itch’. My desktop was exceedingly slow and after virus and spyware checking/cleaning I ran ‘msconfig’ to see what was being loaded on startup. I saw ‘curf itch’ and it seemed suspicous. I unclicked it as a startup item, applied, and rebooted. It keeps coming back and my computer speed continues to be slow. I finally located the .exe file in the Prefetch folder. I deleted but it has come back.
    Does anyone know what program curb itch.exe is a part of?
    Is this the likely reason for the computer’s slow speed?
    Should I get rid of this, and if so, how!

    Any assistance would be greatly appreciated.
    Tom

Comment navigation

 

Post Navigation