WinSxS Folder in Windows 7 | 8 explained

Most of you may have noticed the WinSxS folder in Windows 7 or Windows 8 and been surprised at its size. For those who have not, the folder is situated at C:\Windows\Winsxs and has a whopping size ! Mine is almost 5 GB and has around 6000 folders & 25000 files and occupies almost 40% of the Windows folder ! While the size of this Winsxs folder, in XP is around 25-50 MB; its large size in Windows 8, Windows 7 and Windows Vista, is intriguing, to many ! Check the image below.

winsxs folder windows WinSxS Folder in Windows 7 | 8 explained

So what is the mystery of this Winsxs folder in Windows Vista and later? Let us find so, in this post.

The Winsxs folder, stores multiple copies of dll‘s in order to let multiple applications run in Windows without any compatibility problem. If you browse inside, you will see what look like a lot of duplicate dlls, each having the same name. These are actually, different versions of the same files which are being stored; as different programs may require different versions.

WinSxS folder Windows 7 | 8

In short, Winsxs, which stands for ‘Windows Side By Side’, is Windows native assembly cache. Libraries which are being by multiple applications are stored there. This feature was first introduced, in Windows ME and was considered as Microsoft’s solution to the so-called ‘dll hell’ issues that plagued Windows 9x.

In Winsxs the ‘backup’ folder is the largest as can be noticed in the image below.

winsxs WinSxS Folder in Windows 7 | 8 explained

Again, as can be seen in the image below, in the Winsxs folder, the ‘Other’ File types takes the bulk of the space. These primarily consist of .imd, .ngr, .csd, .dll, .dll.mui, .exe and such other file types.

winsxsfiletypes WinSxS Folder in Windows 7 | 8 explained

In Windows 7, there isn’t a ‘dllcache’ folder and nor can you find the ‘i386′ folder, where the system caches (like in XP) all it’s source modules. It is this WinSxS folder which stores the shared components of side-by-side applications. These files can be multiple versions of the same assembly or application. Every side-by-side assembly has a unique identity. One of the attributes of the assembly identity is its version. “Side-by-side assemblies are used by the operating system as fundamental units of naming, binding, versioning, deployment, and configuration. The Winsxs folder includes all manifests, optional components and 3rd party Win32 files”.

But, why so many subfolders, and why keep so many different versions of the same dll, exe or other files ?

As mentioned, Windows stores the old dll‘s and library components in the WinSxS folder. Now if a newer version of this file is a part of the OS, but a particular application requires a particular older version for running, then the older version from the winsxs folder will be used, leaving the newer version in its present place, for other applications which may require it.

So obviously you cannot delete this directory or move it elsewhere. Nor is it advisable to delete anything here, as such a step could probably make your applications un-workable or even break your system! If you have many applications installed, you can expect to have a jumbo sized winsxs folder. This WinSxs folder cannot reside on any other volume than the system volume. This is because of the NTFS hard links. If you try to move the folder, it may result in Windows updates, service packs, features, etc, not installing correctly.

If you delete components from the WinSxS folder like the manifests or the assemblies, etc, you could be in trouble. Each system would react differently. What may work for one could break another! For instance, if you install a program that requires that particular assembly, which you may have deleted, then that program will just not run! Compressing the folder is also a no-no, as it could cause problems during WindowsUpdates or while installing a Hotfix.

The safest way to clean it, is by simply uninstalling applications which you don’t require. However, this too is not fool-proof, as many applications still leave behind their files here, since they may be shared between other applications. So the probability of dud unused dll‘s being left behind is quite high.

We would not advice the use of WinSxS cleanup tools like WinsxsLite as you could end up breaking your Windows.

And if you are into trying out new software or installing and uninstalling frequently, you may notice that your Winsxs size is indeed large, as Windows will store multiple copies of these dll files, in order to let multiple applications without compatibility problem.

WinSxs Folder Cleanup

Windows 8.1 introduced a new command line option for DISM.exe, /AnalyzeComponentStore. Running this command, will analyze the WinSxS folder and tell you whether a Component Store Cleanup is recommended or not.

In Windows 8, open Disk Cleanup Tool and use the Windows Update Cleanup option to clean the WinSxs.

Microsoft released an Update that added the Windows Update Cleanup option to Disk Cleanup tool in Windows 7.

You can now also clean up WinSxS in Windows Server 2008 R2 with new the new Update.

Here are some other options you may consider to free up disk space – some routine and some extreme:

  1. Run Disk Cleanup tool or CCleaner
  2. Uninstall unused applications
  3. Move Page file to another drive
  4. Disable hibernation
  5. Use the dedicated dump file option to capture memory dump files on another volume on the system.
  6. Disable system restore points
  7. Offload user profile and program file directories to another volume on the system.

Update 1 From TechNet Blogs : One of the largest changes between previous versions of Windows and Windows 7 / Vista was a move from an INF described OS to componentization. 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.

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.

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.

Update 2 From E7 Blogs : “Modularizing” the operating system was an engineering goal in Windows Vista. This was to solve a number of issues in legacy Windows related to installation, servicing and reliability. The Windows SxS directory represents the “installation and servicing state” of all system components. But in reality it doesn’t actually consume as much disk space as it appears when using the built-in tools (DIR and Explorer) to measure disk space used. The fact that we make it tricky for you to know how much space is actually consumed in a directory is definitely a fair point! The WinSxS directory also enables offline servicing, and makes Windows Vista and later “safe for imaging”.

There have been several blogs and even some “underground” tools that tell you it’s ok to delete the WinSxS directory, and it’s certainly true that after installation, you can remove it from the system and it will appear that the system boots and runs fine. But as described above, this is a very bad practice, as you’re removing the ability to reliably service, all operating system components and the ability to update or configure optional components on your system. Windows only supports the WinSxS directory on the physical drive in its originally installed location.

Conclusion

Let the WinSxS folder be as it is!

Post ported from WVC.

Additional reads:

Posted by on , in Category Windows with Tags
Anand Khanse aka HappyAndyK is an end-user Windows enthusiast, a Microsoft MVP in Windows, since 2006, and the Admin of TheWindowsClub.com. Please create a System Restore Point before trying out any software & be careful about any third-party offers while installing freeware. Add me on Google+.
  • http://www.facebook.com/noman.fayez Fayez Ahmed Khan Noman

    thanks for article

  • Guest

    Good Article. I was fixing to use “mklink /J “c:Windowswinsxs” “d:winsxs”
    to save room on my ssd as my winsxs folder shows itself to be 9.39 Gigabytes. After reading this i decided i better buy a Larger SSD. Thanks

  • nei
  • http://www.thewindowsclub.com Anand Khanse
  • Marko Kraljevic

    Getting a larger SSD isn’t an option, when running Windows inside Oracle VM VirtualBox for example.

  • Deepfry

    I’d kill for a 4GB SXS folder, mine is ridiculous @ > 20GB. Killing the smaller drive that I have for my OS install.

  • http://www.thewindowsclub.com Anand Khanse

    Use the Windows Update Cleanup option in Disk Cleanup Tool. Details for Windows 7 users here: http://www.thewindowsclub.com/windows-update-cleanup-disk-cleanup-windows

  • hateMicrosoft

    microsoft sucks. for me that folder takes 12 GB!!! And as I have SSD there are no more space at all in it. Microsoft must die!!!

  • dean

    does the rundll32.exe normally on the winsxs folder? thanks

  • http://www.thewindowsclub.com Anand Khanse

    Yes, you may see several versions of rundll32.exe in the winsxs folder.

  • http://bit.ly/bblplus Prom

    “Let the WinSxS folder be as it is” I cannot agree with this statement. The winsxs folder is something that should go and the sooner that happens the better and easier it will be. It is the result of a decision that microsoft made back with windows 3.0 and while everything including processor scheduling has moved on since then the situation known as DLL hell has only received a patch job and winsxs was born.

    Even looking at your example of rundll I can only find two versions, x86 and amd64, so it doesn’t seem that important in any case. The root of the problem is really microsoft’s visual studio compilers and redistributable dll’s. In the 1990’s memory was scarce and dynamic linking was much preferred to static lib linking. Each application would rather than incorporating library code into the executable link to it at runtime so only one copy is present in memory. But updating shared components often results in previously working programs suddenly no longer working. Ms’s solution to the problem was for the program to specify a compatible version of a DLL and load that thus creating the “side-by-side assemblies.”

    It did solve one problem, in a way, but introduced numerous others. First off the memory saving of shared components has been unrealised with multiple versions present. And let’s face it, we have much more memory today so we can afford to use static linking instead as many other vendors tried to force. Also if one version of a DLL is patched it still leaves others behind that could be a security risk so it may be a detriment to security.

    The correct approach here is to go with the other solution to DDL hell, namely let executables in a single product share the same DLL’s. Dependencies should in any case be stored with the application and not in system folders or the registry.

  • Chris

    Just only about 2 month ago I started with Win7 Pro and that was not voluntarily. I like my new hardware, but the difference between XP and Win7 is a terrible and time consuming issue.
    Of course, since then I have also searched for and read a lot about the winsxs storage monster. And although there is already written so much about this subject, I like to add something to that.

    One of my hobbyhorses is image backups. I can’t remember how long I use already that type of backup for the system drive. However, it is remarkable that I see that advice very occasionally in all the information and discussions at the internet. In case of a Windows or system drive (fatal) malfunction, it is IMHO the only easy, fast and reliable way of recovery. And in less catastrophic situations, restoring an image backup is still the most reliable method for a ‘roll back’.
    So, don’t rely on the Windows Recovery options (I never did) and make image backups. And uninstalling updates I never do too. If there would be a reason for ‘roll back’, I use the reliable way.
    Therefore I have some requests or suggestions:
    To system builders: split up drives in more partitions.
    To software developers: offer always the option for installing at a custom location.
    To Microsoft developers: make the default location for e.g. personal data NOT at the system drive. It is not only storage, but they are lost by restoring if you forget to copy them before.
    Note. All the other suggestions, remarks and complaints would be too much to write here. :-)

    Back to storage and winsxs. It is true that HDD storage is cheap and SSD storage not very expensive anymore. So, for new desktop systems the storage costs don’t count (much), but for older hardware and/or notebooks or tablets it can still be a major issue. But winsxs (and DriverStore) has a considerable effect on the size of the (full) image backup. And there are other (performance) drawbacks, e.g. the time needed for searching the system drive, mounting an image backup or scanning the drive with WinDirStat.
    For me, the main reason of annoyance is that the MS developers probably think that they are covering nearly all system problems by storing a lot of old versions and duplicates in that winsxs folder. Well, IMHO it is the wrong way and at the wrong location. It is rather ironically and frustrating that if you use the safe backup procedure, a lot of that data is superfluous and is increasing the backup data that is stored (cheap) elsewhere!
    Note. I store backups at a partition of the local HDD and copy that data regularly to an external drive.

    An example of the MS stupidity. Mainly for curiosity reasons, I installed some additional system languages (using Win7 Ultimate trial). Such updates install a lot of data and when I tested afterwards the uninstalling, I found that most of that huge increase of data was left behind in the winsxs folder. That conclusion is based on the results of WinDirStat and the sizes of image backups. My description of that residue is ‘superfluous rubbish’.
    So, I don’t think that uninstalling old/unused software will cleanup that messy winsxs folder.
    Unfortunately, it’s nearly impossible for a user to delete some of that garbage in an easy and safe way. I don’t know yet if e.g. the winsxsBackup folder really contains old data that is not used anymore.

    And then the argument that it is necessary to keep all the old versions of DLL’s there. I think that it is very likely that most (decent) software is working properly with the newer versions too.
    Well, to discuss is the question if every user should be bothered with a lot of unused data because some users are (maybe occasionally) using a program that needs an old specific DLL version. In that case it would be better that the software developer has made his own DLL (version) and install that at the program location. Btw, much software is still doing that.
    Note. I don’t understand that if a system DLL is changed significantly, the name is not changed too.

    Another disputable large storage folder is ‘DriverStore’ (FileRepository).
    Note. I’m not fully sure if this folder is a repository of only non-active or non-installed drivers.
    Win7 is still shipped with and installs a lot of drivers for nearly everything. Maybe that was obviously till e.g. 10 years ago, but in my opinion no longer needed anymore. Of course, the installation DVD should contain all the drivers and other stuff that is necessary for a successful installation at all the possible hardware. But installing all that data at the local system drive??
    When I have to install some driver, I nearly always look for the latest version on internet. But before that is possible, the ‘vital’ LAN driver has to be installed. However, that driver was (probably) not included in Win7 and for my ASUS P8H77-V motherboard I have to use the ‘Support CD’.
    Note. A good new feature of Win7 is the possibility that the system can search the internet when it needs a driver after installing new hardware. Well, for me that is nearly ‘Plug and Play’ too.
    So, once again: why all that stuff at the local system drive?

    A final (‘funny’) remark about the ‘Cloud’.
    For many years it seems to be normal and it is pushed to use the Cloud for storing nearly everything. But what is Microsoft doing: they put a lot of (even unused or obsolete) data at the local system drive! :-)

    Note. At the technet website there is a thread with exactly the same title as this article and at the bottom there is a long explanation with remarks and opinions that I like.

  • OMA

    If WinSxS was first introduced in Windows ME, how did they actually implement it in that version of Windows? Windows ME only worked in FAT filesystems, and those didn’t have fancy features such as hard links. So they actually duplicated the files in Windows ME so they took twice the space?!

  • TheMalgot

    DISM.exe has no /AnalyzeComponentStore command line option in Windows 8.1

  • http://www.thewindowsclub.com Anand Khanse
  • Recent Comments