Posts tagged with: ssd

Windows 7 winsxs folder – what is it? why is it growing? how to reduce the size?

What is winsxs folder?

Microsoft made a lot of changes and enhancements in Windows Vista promising better security and usability. One of the thing previously not in prior Windows that they added is a folder called winsxs. It means windows side-by-side. Nothing much is known then about this folder but a lot of users are complaining that it keeps on growing bigger and bigger taking up to 15GB for some people. This winsxs system was then also ported into windows 7 which brings us to continue asking this question.

So what is this winsxs folder and what is so important about it that we cannot delete anything in it?

Well, I am going to give a simple nutshell explaination. If you want detailed explanation and analysis of this folder and what it does EXACTLY, then head for these links.

<links>

Basically winsxs folder contain a lot of hardlinks or junction points (as being called by microsoft) to a lot of system files. It keeps a lot of different versions of systems files which probably is used for when rolling back drivers and so on. So these files are actually just linkage to other files in your windows system. I think there are also some real physical files there but all these are managed by windows and never explained by microsoft on the structure of this winsxs folder.

Why does winsxs folder keep on growing in size?

When you look at the properties of this folder, the file size listed is not really the physical space taken up due to them being links and not physical files.

Here is an example that someone did experiment on junction points. It explain well on how windows cannot report disk space usage as opposed to linux’s link system. This is the main reason which causes confusion about winsxs.

  • Assuming there is this test D: drive with 1000MB disk space left.
  • We create an empty folder called test123.
  • Copy a file that is 100MB in size into folder test123.
  • Check the space usage and we see 900MB space left. So far so good.

 

  • Next we create 3 junction points in folder test123 that points to the 100MB file.
  • So we have 4 files there with 1 is actually physical file of 100MB.
  • However, when we check the disk space properties for folder test123, it report 400MB being used by this folder.
  • Check free disk space and it is still around 900MB. For explanation sake, we ignore the small space used by each junction point for the pointer file.

So you see, when checking disk space used by junction point, windows port the file size of the physical file it is pointing to. This is essentially how junction point works in windows. Not very smart design by windows engineer.

Back to the winsxs folder. You now know why when you do drivers updates and windows updates, winsxs folder size keep growing and growing. But if you check you free diskspace, the growth doesn’t tally.

How to reduce winsxs size without screwing up my Windows?

Before starting on clearing up winsxs space. You can first run a Post Windows 7 SP1 cleanup. For those who have already applied Windows 7 SP1. This will clean up virtual space of around 5GB. Because remember, 5GB reported by windows on winsxs folder does not equal REAL 5GB. In actuality, around 500MB are saved. Looks at screenies below.

DISM /online /Cleanup-Image /SpSuperseded

[cc lang=”dos” escaped=”true” width=”100%” lines=”5″]
C:\>dir/w
Volume in drive C has no label.
Volume Serial Number is 1EB4-6A03

Directory of C:\

.rnd                        autoexec.bat
config.sys                  [HP Universal Print Driver]
HP2030.log                  [PerfLogs]
[Program Files]             [Users]
[Windows]
4 File(s)         40,638 bytes
5 Dir(s)  54,660,644,864 bytes free

C:\>DISM /online /Cleanup-Image /SpSuperseded

Deployment Image Servicing and Management tool
Version: 6.1.7600.16385

Image Version: 6.1.7601.17514

Removing backup files created during service pack installation.
[==========================100.0%==========================]
Service Pack Cleanup operation completed.
The operation completed successfully.

C:\>dir/w
Volume in drive C has no label.
Volume Serial Number is 1EB4-6A03

Directory of C:\

.rnd                        autoexec.bat
config.sys                  [HP Universal Print Driver]
HP2030.log                  [PerfLogs]
[Program Files]             [Users]
[Windows]
4 File(s)         40,638 bytes
5 Dir(s)  55,099,588,608 bytes free

C:\>
[/cc]

Now that you know the usage size reported on winsxs is not the correct exact storage used, do we still need to find a way to reduce the size? How do we find out exactly how much space is actually used by winsxs? My answer is yes and no.

Despite Windows over reporting the size of winsxs, it still in some way take up unnecessary space. That might be nothing when you have a 500GB HDD. However, when it comes to SSD, this is a different story. SSDs are still very expensive. Some people only have 20GB for SSD and every MB counts. So I would recommend trying to reduce unnecessary storage taken up to files that we hardly ever touch.

After some googling, the only tool that I found to be able to help clear up winsxs is winsxslite created by Christian Bering Boegh. This is basically a “bat” file running DOS commands. It depends on a few DOS command line tools which is listed in “Help” section when you run the software. I have to say this tool is amazingly complex. It take a lot of time when running it just to come up with the list of actual physical space taken up by winsxs. I tried it on a Windows 7 SP1 laptop and it took me around 5 hours to finish Stage 1 of this tool. There is another stage 2 which I did not bother to run at it is really time consuming. I did end up saving around 1GB by the end of stage 1. However, I do not recommend anyone running this as it is quite a hassle and normal user would find it difficult just to download the third party tools required to get this software running.

By now, you know what winsxs is about. Some might also be wondering why Microsoft engineers designed such an insufficient system. Something that waste resources. I don’t know if this is totally a lousy system because everyone also hated Windows Registry system when it was introduced in Windows 95. It’s not that bad once everyone got used to it by now. I guess same thing applies to winsxs. We will probably see more tools released by third party that can optimize it more efficiently. Until then I guess most of use will need to stick to it and leave it to it’s own devices. BTW, I still don’t really fancy registry and still think it sucks. LOL…