Stephen Smith's Blog

Musings on Machine Learning…

Windows Bit-Rot

with 9 comments


Introduction

In investigating some performance problems being reported on some systems running Sage 300 ERP, it lead down the road to investigating Windows Bit-Rot. Generally Bit-Rot refers to the general degradation of a system over time. Windows has a very bad reputation for Bit-Rot, but what is it? And what can we do about it? Some people go so far as to reformat their hard disk and re-install the operating system every year as a rather severe answer to Bit-Rot.

Windows Bit-Rot is the tendency for a Windows system to get slower and slower over time. Becoming slower to boot, taking longer to log-in, and taking longer to start programs. Along with other symptoms like excessive and continuous hard disk activity when nothing is running.

This blog posting is going to look at a few things that I’ve run into as well as some other background from around the web.

Investigation

I needed to investigate why on some systems printing Crystal reports was quite slow. This involved software we have written as well as a lot of software from third parties. On my laptop Crystal would print quite slowly the first time and then would print quickly on subsequent times. My computer is used for development and is full of development tools, so the things I found here, might be relevant to myself more than real customers. So how to see what is going on? A really useful program for seeing what is going on is Process Monitor (procmon) from Microsoft (from their SysInternals acquisition). This program will show you every access of the registry, the file system and the network. You can filter the display, in particular you can filter to monitor only a single program to see what it’s doing.

procmon

ProcMon yielded some very interesting results.

The Registry

My first surprise was to see that every entry in HKEY_CLASSES_ROOT was read. On my computer which has had many pieces of software installed, including several versions of Visual Studio, several versions of Crystal Reports and several versions of Sage 300 ERP, the number of classes registered here was huge. OK, but did it take much time? Well the first time something that’s run that does this it seems to take several seconds, then after this its fast probably because the registry ends up cached in memory. It appears that several .Net programs I tried do this. Not sure why, perhaps just .Net wants to know all the classes in the system.

But this does mean that as your system gets older and you install more and more programs (after all why bother un-installing when you have a multi-terabyte hard drive?), starting these programs will get slightly slower and slower. So to me this counts as Bit-Rot.

So what can we do about this? Un-installing unused programs should help, especially if they use a lot of COM classes. Visual Studio being the big one on my system, followed by Crystal and Sage 300. This helps a bit. But there are still a lot of classes there.

Generally I think uninstall programs leave a lots of bits and pieces in the registry. So what to do? Fortunately this is a good stomping ground for utility programs. Microsoft used to have RegClean.exe, Microsoft discontinued support for this program, but you can still find it around the web. A newer and better utility is Ccleaner from Piriform. Fortunately the free version includes a registry cleaner. I ran RegClean.exe first which helped a bit, but then ran Ccleaner and it found quite a bit more to clean up.

Of course there is danger in cleaning your registry, so it’s a use at your own risk type thing (backing up the registry first is a good bet).

At the end of the day all this reduced the first time startup time of a number of program by about 10 seconds.

Group Policy

My second surprise was the number of calls to check Windows Group Policy settings. Group Policy is a rather ad-hoc mechanism added to Windows to allow administrators to control networked computers on their domain. Each group policy is stored in a registry key, and when Windows goes to do an operation controlled by group policy, it reads that registry key to see what it should do. I was surprised at the amount of registry activity that goes on reading and checking group policy settings. Besides annoying users by restricting what they can do on their computer, it appears group policy causes a general high overhead of excessive registry reading in almost every aspect of Windows operation. There is nothing you can do about this, but it appears as Windows goes from version to version, that more and more gets added to this and the overhead gets higher and higher.

Auto-Updates

You may not think that you install that many programs on your computer, so you shouldn’t have these sort of problems but remember many programs including Windows/Microsoft Update, Adobe Updater and such are regularly installing new programs on your computer. Chances are these programs are leaving behind unused bits of older versions that are cluttering up your file system and your registry.

Auto-Run Crap

Related to auto-updates, it appears that so many programs now run as icons in the task bar, install Windows services or install programs to run when you log-in. All of these slow down the time it takes you to boot Windows and to sign-in. Further many of these programs, say like Dropbox, will keep frequently polling their server to see if there are any updates. Microsoft has a good tool Autoruns for Windows which helps you see all the things that are automatically run and help you remove them. Again this can be a bit dangerous as some of them are necessary (perhaps like a trackpad utility).

Similarly it seems that everyone and their mother wants to install browser toolbars. Each one of these will slow down the startup of your browser and use up memory and possibly keep polling a server. Removing/disabling these isn’t hard, but it is a nuisance to have to keep doing this.

Hard Disk Fragmentation

Another common problem is hard drive fragmentation. As your system operates the hard disk becomes more and more fragmented. Windows has a de-frag program that is either scheduled to run when your computer is turned off or you never bother to run it by hand. It is worth de-fragging your hard drive from time to time to speed up access. There are third party de-frag programs, but generally I just use the one that comes built into Windows.

Related to the above problems, often un-installation programs leave odds and ends files around and sometimes it’s worth going into explorer (or a cmd prompt) and deleting folders for un-installed programs. Generally it reduces clutter and speeds up operations like reading all the folders under program files.

Dying Hard Drives

Another common cause of slowness is that as hard drives age, rather than just out right failing, often they will start having to retry reading sectors more. Windows can mark sectors bad and move things around.  Hard drives seem to be able to limp along for a while this way before completely failing. I tend to think that if you hear your hard drive resetting itself fairly often then you should replace it. Or when you defrag if you see the number of bad sectors growing, then replace it.

Summary

After going through this, I wonder if the people that just reformat their hard drive each year have the right idea? Does the time spent un-installing, registry cleaning, de-fragging just add up to too much? Are you better off just starting clean each year and not worrying about all these maintenance tasks? Especially now that it seems like we replace our computers far less frequently, is Bit-Rot becoming a much worse problem?

Written by smist08

May 4, 2013 at 2:31 pm

9 Responses

Subscribe to comments with RSS.

  1. […] Introduction In investigating some performance problems being reported on some systems running Sage 300 ERP, it lead down the road to investigating Windows Bit-Rot. Generally Bit-Rot refers to the …  […]

  2. Side-by-side version control of Visual Studio and Crystal I though would alleviate bit-rot, apparently not, via your registry research. Windows needs a new file system (long overdue). Till then SSD + reformat every year (or buy a Mac)

    boulton clive

    May 5, 2013 at 3:20 am

  3. This is just one more reason I choose to do all development on a VM running from the laptop. My laptop therefore has only business critical software, and stays relatively unchanged, outside of Windows Updates. I also use SmartDefrag which auto-defrags the file system “on the fly” when the system is idle, as well as CCleaner and TreeSize Pro to periodically see which files are taking up large amounts of disk space. It’s not that hard to keep the system running smoothly just by being a bit proactive. .

    Stacy

    May 6, 2013 at 1:36 pm

    • My Macbook Pro used for development since May 2008 I’ve not had to reformat or mess around ccleaning / defragging. The MBP is bootcamped to run Visual Studio, but increasingly ambient era applications don’t need .Net, thus no need to run bootcamp. It’s almost as if the inconvenience of Windows trained me and thousands of other developers to run OSX. But there’s a bit more to the back story like crappy Windows laptops and the shift to ambient era canonical development.

      boulton clive

      May 6, 2013 at 4:11 pm

  4. Great summary, thanks Stephen. The tools from Microsoft that they acquired (along with Mark and Bryce) are incredibly useful for troubleshooting (and learning) Windows.

    rsisk101

    May 6, 2013 at 3:40 pm

  5. Agree to your points here Smith. I too faced the common error ‘server busy this action cannot be completed because the other program is buy. switch to…’ and tried to remove entries in the startup, disabled anti virus, stopped auto updates, etc., and ultimately found that the issue was on the bad hardware. What a palaver.

    Sundaresan

    May 7, 2013 at 7:36 pm

  6. […] in this blog posting. In some ways this blog posting is going to be similar to my posting on Windows Bit Rot since it ended up involving many of the same […]

  7. Dude bit rot isn’t your windows machine slowing down. Its the tendency for old storage to flip 0’s to 1’s and vice a versa which corrupts files.

    Stewart

    December 11, 2015 at 12:37 pm

  8. […] became slower and slower running Windows 10. Now with Ubuntu Linux, it runs great. No more Windows bitrot and it has a whole new […]


Leave a reply to Pulling My Hair Out Over GPO | Stephen Smith's Blog Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.