The Windows Servicing Guy

Tips and tricks from a Windows support engineer on issues related to servicing

Alleviating pressure caused by component store size

Alleviating pressure caused by component store size

  • Comments 27
  • Likes

I just wanted to make you all aware of a new KB article myself and a couple of teammates put together around component store growth and remediation.  I wanted to have something short and to the point and I think a lot of you might find this more useful than sifting through the blog trying to piecemeal together the same information.  I'll probably try to put together something a little more verbose here that goes more into the internals of some of this but I am busy working on a new project and dont have tons of time.  If you have any questions or comments about the material please ask them here.

http://support.microsoft.com/kb/2795190/EN-US

--Joseph

Comments
  • I want a tool running as scheduled task each month after the Patchday to check for superseded updates and remove them to keep the WinSxS folder as small as possible.

    Please create such an tool for us.

  • Your new KB article has a link in it:

    blogs.msdn.com/.../disk-space.aspx

    That blog posting seems to contradict what you said in an earlier posting here :

    blogs.technet.com/.../how-hard-links-work.aspx

    You said:

    "This is how the component store functions.  All operating system files are placed into organized subdirectories under the WinSXS directory.  When a role is added, we simply create a new links to the appropriate files, usually linking them to the System32 or SysWOW64 directories"

    The other guy says:

    "nearly every file in the WinSxS directory is a “hard link” to the physical files elsewhere on the system—meaning that the files are not actually in this directory. For instance in the WinSxS there might be a file called advapi32.dll that takes up >700K however what’s being reported is a hard link to the actual file that lives in the Windows\System32"

    So YOU say that the "actual real" files are in the WinSxS directory and from that directory hardlinks point OUT from that directory to other directories creating "virtual files".

    HE says that the WinSxS directory only contains hard links ( virtual files ) and the "actual real" files are in all of the other directories.

    So who is correct ?

  • We both are because it's about context.  My hard link blog is talking about the mechanism's of hardlinks and how they are distributed throughout an NTFS volume, Steven's blog was written to attempt to explain how those links are counted and why the size of the component store appears much larger than it actually is (due to the way explorer counts hard links).   One is the mechanism, the other is the result.

    The idea of a "real" file is also contextual.  For explorer, any file and its hard links are counted as real files.  From an NTFS perspective, there is one "real" file with multiple references.  The real file in this case would be the location of last reference to the file when all other hard links have been deleted.

    For example, using advapi32.dll, it exists in the component store (Winsxs) and the system32 directory.  To the explorer process, this exists as two files and so its counted twice by explorer.  From an NTFS perspective, it's just a single file on the disk with two references.  NTFS will update it's file record when anything on the file has changed and the hard linking mechanism will update that file throughout the volume.

    --Joseph

  • My brother-in-law is a Microsoft Project Manager, so I hear more than I should.

    Investors wonder why Microsoft stock just floundered for years, while new companies and Google had so much success.

    Oracle stock ran from 15 to 35 during the past five years.

    Google stock ran from 380 to over 700 during the five year period

    Microsoft stock traded from 28.84 DOWN to a current price of 25 during the five years.

    Why? Microsoft is too soft. Their executives are soft as compared to associates and executives at Google, Oracle and other successful competitors that steal their secrets . . . build their own companies . . . and then sell them to Microsoft! I know. My brother-in-law, Peter Leonard, is a Project Manager at Microsoft, so I've seen first hand just how soft and lazy these guys can get, not to mention the "who cares" attitude. Not to mention talking too much and dragging projects out so long, that the competition is ready to go to market by the time Microsoft is ready to go to Beta.

    All Microsoft execs and managers care about is a cushy job, nice dining room with great benefits and tons of time off. And when they don't get enough time off, they create it. Yes, I kid you not, they create time off hours off and fun time. They have the benefits of working at home . . . or from a beach in the Islands or anywhere they please, as long as there is a phone and an Internet connection. Believe me, I've been on those trips when he was "working" on the beach, in the pool, sipping pina coladas and enjoying the life of leisure.

    If Larry Ellison caught one of his executives on a "working" day like this, he'd probably hang him from the top floor of the Oracle Building or from the mast of his sailing yacht, maybe even drag him behind his yacht as shark bait. But when he is really on the ball, he finds them a job at Microsoft.

    Look at all the time Microsoft has had to catch Google with a Search Engine. Their first attempt failed miserably. Second attempt was to buy Yahoo, but Ballmer bungled that with an ego as big as his head, and probably a hundred execs and managers below him advising him . . . we can do it better. How? On the beach? At home? In the hot tub? Now they have Bing. Well, Bing This, because Bing is a complete failure because of guys like my brother-in-law who are there for the benefits, and not willing to take any chances or come up with anything new that might rock the boat of their executives that care more about the security of their positions than the guys and gals below them.

    They talk about things they should not be talking about, so the competition can either leap frog them or incorporate their good ideas into their development, and avoid the mistakes made at Microsoft. I've heard things I should not have heard, so I'm sure others have. If you can't keep your trap shut at Microsoft, you've got problems.

  • Hi Joseph.

    It's a useful article. Thanks. My two bits worth...

    * Adding the following links via the exe names would be helpful.

    Windows Vista or Windows Server 2008 Service Pack 1: VSP1CLN.EXE msdn.microsoft.com/.../cc709655.aspx

    Windows Vista or Windows Server 2008 Service Pack 2: Compcln.exe technet.microsoft.com/.../dd335037(WS.10).aspx

    Windows 7 or Windows Server 2008 R2 Service Pack 1: DISM /online /Cleanup-Image /SpSuperseded or Disk Cleanup Wizard (cleanmgr.exe) blogs.technet.com/.../how-to-reclaim-space-after-applying-service-pack-1.aspx I used your post for the DISM command because the switches are missing from this reference; technet.microsoft.com/.../dd744311(v=WS.10).aspx. For Cleanupmgr.exe; support.microsoft.com/.../315246 (XP command line) and/or support.microsoft.com/.../en-us (reclaim space -XP & WS2008).

    * If Vista SP2 is installed (to machine running SP1), does Compcln.exe remove both superseeded by SP1 and SP2 files, or is it necessary to also run vsp1cln.exe after installing SP1 but before installing SP2?

    * "Disable hibernation on the system". It would of course be preferable in some cases if hiberfil.sys could be moved from the boot partition, to a data partition. forum.sysinternals.com/change-location-of-hiberfilsys_topic26183.html

  • Thanks Drew;

    Good comments on both accounts, I'll see what I can do to have those added.

  • How often, or under what circumstances, is scavenging performed automatically on Windows 7?

    Typo: the sentence beginning "NOTE: Scavenging is performed automatically on Windows 7" does not have a full stop.  (Or is part of the sentence missing?)

  • @Andre;

    Not a bad idea, but might be tough to implement, I'll add this to my list :)

    @Harry;

    The way we do it in Win7/2008R2 is on an interval where the processor has been at idle for a certain period, it will trigger the scavenger to run.  I'll look into the type, thanks!

  • I know Joseph :( But it's the ONLY way to really reduce the space usage and it makes sense to have a lower amount of packages which the servicing stack has to handle to avoid slowdowns.

  • Example - system with both kb2548120 and kb2549079 installed.  I think the latter supercedes the former.  Performed an uninstall with WUSA /uninstall /kb:2548120.  Uninstall is successful, reboot.  DISM /Get-Packages no longer shows kb2548120.

    But ... the kb2548120 migUiControls.dll 21725 still exist in winSxS, hence no reduction in disk consumption.  Is this the correct result?  Thanks.

  • Yes, thats the correct result.  Uninstalling the update in this case only moves the package to a staged state, meaning, its still on the disk in the event that you need it later (because possibly you remove the supersedent KB).  Eventually, the scavenger will remove the files like these.

  • @tester

    the files are removed later when the PC is idle. Also if you remove packages from an image, the files are still in the WIM and will be deleted after you installed the Windows.

    Wait a few minutes and the files are gone.

  • thanks!  a tool/script to uninstall (or least list) the superceded hotfixes would be great!

  • I appreciate the effort for the article and I am also thankful for how you patiently handle comments here but please please please change the design for Windows 8 to require very minimum amount of space. As a user, I am ready to make any tradeoffs like not being able to uninstall or revert hotfixes at the cost of less disk space consumed. Also, there needs to be a way to install packages unattended but with a visual progress bar. XP's Package Installer (update.exe) was perfect and Vista ruined every single aspect of it. I am actively persuading anyone and everyone I know with an SSD to completely avoid Windows 7 and Vista (even though W7 includes improvements like TRIM support) just because of the bloated servicing store. I am expecting and looking forward to major improvements in Windows 8 for servicing so we can have the best of update.exe's features and Vista's package manager.

  • The hibernation file can also be compressed in Windows 7 as documented in this article (download.microsoft.com/.../HiberFootprint.docx). I have 6 GB of RAM and on Windows 7, setting it to 60% does not cause any issues when resuming and saves some disk space.