Technology Toolbox

Your technology Sherpa for the Microsoft platform

Jeremy Jameson - Founder and Principal



An Update on the Effectiveness of MaxPatchCacheSize

In my previous post, I shared a couple of PowerShell scripts that I wrote for quickly setting and verifying the MaxPatchCacheSize registry setting. I also stated that this registry setting has, unfortunately, become less effective over the years since my original post on this subject.

For example, here's what the disk usage looks like on one of my development VMs:

Note that the \Windows\Installer folder is consuming almost 5.5 GB of space on the VHD -- despite the fact that I set MaxPatchCacheSize to 0 immediately after creating the VM.

5.5 gigabytes isn't all that much when your hard drive is several hundred gigabytes -- or perhaps even a terabyte or two -- in size.

However, the same number is a different matter altogether on VHDs that you are trying to keep as small as possible. For example, maybe like me, you have a number of VMs running on SSDs. In that case, multiplying the "wasted space" in the Windows Installer folder by the number of VMs is, well, aggravating.

Also note from the screenshot above there's a considerable amount of disk space consumed by the following folders:

  • C:\ProgramData\Package Cache
  • C:\Users\All Users\Package Cache
  • C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Update Cache

In other words, not only is a significant amount of space being wasted in the Windows Installer folder (which is supposed to be controllable using the MaxPatchCacheSize setting), now we also have several other locations that chew up precious cells on SSDs.

In this particular case, the bloat in the Package Cache folders is due to installing Visual Studio 2012.

Unfortunately, it seems like this is just the way it's going to be from now on -- at least according to Heath Stewart from Microsoft:

Heath, if you're reading this, then sorry, but I think Microsoft's decision to force this bloat on us is, um, stupid. Okay, maybe shortsighted is a softer way to put it. I don't deny the numbers you reference in your blog post; I just wish you provided a better response to the SSD scenario (especially in light of the fact that many folks rely heavily on virtualization these days).

All I'm asking for is to make the installation caches configurable. In other words, something like the MaxPatchCacheSize registry setting -- except something that actually works as intended ;-)

The development VM that I captured the above screenshot from has the following software installed:
  • Windows 7 (64-bit)
  • Microsoft Visual Studio 2008
  • Microsoft Visual Studio 2008 Team Explorer
  • Microsoft Visual Studio 2008 SP1
  • Microsoft Visual Studio 2010
  • Microsoft Visual Studio 2010 SP1
  • Microsoft Team Foundation Server Power Tools December 2011
  • Microsoft Visual Studio 2012
  • Microsoft Visual Studio 2012 Update 2
  • Microsoft SQL Server 2012 with SP1
  • WiX Toolset v3.7
I don't typically install more than one version of Visual Studio in a VM. However, I built this "uber Visual Studio VM" in order to debug some issues with the TFS Integration tool (which I use to synchronize my local TFS team projects with my clients' TFS instances).


No comments posted yet.

Add Comment

Optional, but recommended (especially if you have a Gravatar). Note that your email address will not appear with your comment.
If URL is specified, it will be included as a link with your name.

To prevent spam from being submitted, please select the following fruit: Watermelon

Please add 2 and 6 and type the answer here: