Windows – does the /winsxs folder grow so large, and can it be made smaller


A Vista virtual machine I use only has a 10 GB virtual hard disk — and I'm worried about it running out of space over time.

I used TreeSize to check for the culprits..

enter image description here

And the primary culprit is that /winsxs or "Windows Side-By-Side" folder.

enter image description here

What is the Windows Side By Side folder? Well, that's explained pretty well here.

All of the components in the operating system are found in the WinSxS folder – in fact we call this location the component store. Each component has a unique name that includes the version, language, and processor architecture that it was built for. The WinSxS folder is the only location that the component is found on the system, all other instances of the files that you see on the system are “projected” by hard linking from the component store. Let me repeat that last point – there is only one instance (or full data copy) of each version of each file in the OS, and that instance is located in the WinSxS folder. So looked at from that perspective, the WinSxS folder is really the entirety of the whole OS, referred to as a "flat" in down-level operating systems. This also accounts for why you will no longer be prompted for media when running operations such as System File Checker (SFC), or when installing additional features and roles.

That explains why the folder starts off big, but not why it gets larger over time – the answer to that question is servicing. In previous versions of Windows the atomic unit of servicing was the file, in Windows Vista it’s the component. When we update a particular binary we release a new version of the whole component, and that new version is stored alongside the original one in the component store. The higher version of the component is projected onto the system, but the older version in the store isn’t touched. The reason for that is the third part of why the component store gets so large.

Lots of other people complaining about the size of the /winsxs folder, too:

A coworker recently received his every two year work laptop refresh and was in the middle of loading his new laptop with Vista. For some reason, his hard drive C: was partitioned to only 25GB and the rest of the space reserved for a much larger drive D:.

Anyway, after loading many Windows Updates, he was left with hardly any drive space left on C:, and for some reason, the WinSxS directory had ballooned to over 8GB.

While I knew what the WinSxS (Windows Side-by-Side) directory was for, I wasn't quite sure why that directory would explode in size so fast with normal operating system updates.

I don't really care about having all these duplicate files for safety, but I do care about the VM exploding due to an out of disk space error. So.. can /winsxs be safely pared down in any way? It doesn't seem that it can be..

Administrators should not, for any reason, take it upon themselves to clean out the /winsxs directory – doing so may prevent Windows Update and MSI from functioning properly afterwards. Preventing accidental deletion from the directory is accomplished by putting a strong security descriptor on the directory that inherits to its children.

If this /winsxs folder gets any larger, I'm going to have to re-image this virtual machine.. which I really don't want to do!

Best Answer

There is a nice command that cleans up after a Windows 7 SP1 installation (it saved me around 3 GB):

DISM /online /cleanup-Image /spsuperseded

Must be executed from an elevated command prompt