Microsoft Enterprise Platforms Support: Windows Server Core Team
A commonly asked question among people looking at a Windows Vista or Windows Server 2008 installation is “why is the WinSxS folder so big?!” To answer that question I need to first describe componentization, and how components are managed in Windows Vista.
One of the largest changes between previous versions of Windows and Windows Vista was a move from an INF described OS to componentization. A component in Windows is one or more binaries, a catalog file, and an XML file that describes everything about how the files should be installed. From associated registry keys and services to what kind security permissions the files should have. Components are grouped into logical units, and these units are used to build the different Windows editions.
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.
Not every component in the component store is applicable, meaning that not every component should be projected onto the system. For example, on systems where IIS is available but has not been installed, the IIS components are present in the store, but not projected into any location on the system where they might be used. If you’re familiar with how multi-branch servicing works in previous versions of Windows then it’ll make sense to you that we have a different version of the component for each distribution branch and service pack level, and that all these different versions are also stored in the WinSxS folder, even if they’re not immediately applicable. So a single Post SP1 GDR package that contains an update to one component will end up installing four versions of that component in the WinSxS folder – double that on a 64 bit operating system for some components.
Now that you know why the store can grow to be so large, your next question is probably to ask why we don’t remove the older versions of the components. The short answer to that is reliability. The component store, along with other information on the system, allows us to determine at any given time what the best version of a component to project is. That means that if you uninstall a security update we can install the next highest version on the system – we no longer have an “out of order uninstall” problem. It also means that if you decide to install an optional feature, we don’t just choose the RTM version of the component, we’ll look to see what the highest available version on the system is. As each component on the system changes state that may in turn trigger changes in other components, and because the relationships between all the components are described on the system we can respond to those requirements in ways that we couldn’t in previous OS versions.
The only way to safely reduce the size of the WinSxS folder is to reduce the set of possible actions that the system can take – the easiest way to do that is to remove the packages that installed the components in the first place. This can be done by uninstalling superseded versions of packages that are on your system. Service Pack 1 contains a binary called VSP1CLN.EXE, a tool that will make the Service Pack package permanent (not removable) on your system, and remove the RTM versions of all superseded components. This can only be done because by making the Service Pack permanent we can guarantee that we won’t ever need the RTM versions.
So yes, the WinSXS folder is very large, and it will continue to grow as the OS ages. I hope that this clears up some of the questions about why that is, and what you can do about it. Note that the Windows servicing structure and the layout of the store is subject to change.
Joseph Conway Senior Support Escalation Engineer Microsoft Enterprise Platforms Support
@all; Sorry I dont tend to look over this post here because I regularly post on my own blog regarding servicing matters. It's located here: blogs.technet.com/.../joscon
@Joss; If you're seeing that kind of space growth its most likely not coming from \winsxs. If it is, I would be interested to know what directories are holding that space.
@Brad; You dont need to provision 80GB drives in a virtual environment unless you plan on storing application/user data there. Otherwise, the recommendation is 40GB for environments:blogs.technet.com/.../general-guidance-on-disk-provisioning-for-winsxs-growth.aspx . You can save a little bit of space when it comes to these images by moving things like the page file and usng a dedicated dump file. Disabling hibernation can also help with overall space usage.
@Rollin; No, you cannot remove the AMD files, it will cause servicing issues on installations, specifically during SP1 installations.
@Mike; Is there something engineering specific that you have a complaint about or is it only size related? Generally the servicing changes in Windows are a lot better than they were in downlevel operating sytsems like Windows 2003
Ping me via my blog with questions
/offtopic I had to lol at the intel-user-deletes-amd-files question... people were not thought that x86-64 is an AMD "invention" and MS named amd64 all 64-bit components that make up the x64 edition of Windows.
/ontopic My problem is that I installed SP1 through Win Update... it was only a few MB since I had most of the pre-SP1 updates installed, but now I don't have that cleanup tool. What do I do? Download 1.4GB of SP1 again just for the tool?
Apparently I don't have to, the feature got integrated in Disk Cleanup... nice touch.
There is a short answer to the question: It contains Windows components. It is so big and gets bigger because the developers & product managers made a very big mistake.
So Winsxs is like an inoperable digital cancer. It will die eventually because of the growth(mine is 40Gb now, on a 75Gb disk) or you can kill it now by deleting stuff. And the message from the doctor's is "Don't cry, your system will die reliably?"
I am going back to XP now!
I actually found this which was really helpful and allowed me to remove the \winsxs\ManifestCache\* files which gained me a couple of GIGS of free space... Thanks Shekhar S - Microsoft Support
All the necessary files for specific additions, roles, applications will be contained in the %windir%\Winsxs directory. The %windir%\winsxs folder (also referred to as the component store) is used to store all the installation source files that are needed for Windows to service itself and its optional components, which takes the place of the traditional flat from media.
To achieve saving some space there is a workaround – to manually delete some folders from WINSXS. Take great care what folders you can delete, because you may break the functionality of your Windows installation and render your product unsupported.
a. Click on start and type cmd in the search bar and right click on cmd.exe in the search pane and click Run as administrator.
n. Navigate to folder C:\Windows\Winsxs
c. Run this command:
Net stop trustedinstaller
NOTE: Wait for this service to stop and ensure it stops successfully. If you are unable to stop the service, you must restart your machine. Do not attempt the next step if you are unable to stop the trustedinstaller service.
d. Then execute these commands:
Takeown /f %windir%\winsxs\ManifestCache\*
e. You should now have available, some more free disk space.
Hope this helps.
Del /q %windir%\winsxs\ManifestCache\* Icacls %windir%\winsxs\ManifestCache\* /GRANT administrators:F
Takeown /f %windir%\winsxs\ManifestCache\*
Great but how do you clean it up? My winxs folder is 10GB large... and I have not installed software willy nilly other than the usual windows updates.
Here is what you need to do to clean it(works in win 7 Ult, not tested in vista or other oses):
open command prompt as admin, then type:
dism /online /cleanup-image /spsuperseded
A good answer for a terrible problem. That said, incompetence should not be tolerated. No wonder AAPL is kicking your butt.
It's just there to increase your windows half-life rate. It's planned obsolescence. The average user will not know they can clone to larger drive when this folder gets to big to use windows anymore and will have to reload, and probably will not have the key anymore... so they will buy the next version of windows.
winsxs- Most annoying folder after original OS data. Taking up so much damn space of my disk. why not make new updates more reliable so that old updates are not required any longer?
This looks like a horrible way for an operating system to manage things. This is why i use Ubuntu Linux. This information was very useful for helping out my friends pc thanks!
Nothing of this would be needed if a good dependency tracking package format would be in place. Then again, one of the most expensive things about running windows is how much patience it takes to cope with M$ crap.
This may be the best technical explanation of an OS feature change that I have ever seen. Well done. I wish that all changes were so well documented.