I have previously written about how the Application Streaming client prunes the file system cache.  What was not discussed is how the streaming system manages the REGISTRY portion of the execution content.   This post brings attention to that need and provides a reference to a source code application that can assist with pruning the registry portion of the execution cache.

When the streaming system executes an application, it can run more than one version of the application at the same time.  New versions of the app can be used by user B when user A is still using the old version.  This way, the admin can update an application “hot” and when users closes and restart the application, they get the new version.  This covered in some details in the discussion of RADE.

What is not obvious is that while the streaming system file system cache has a high water/low water algorithm for managing the cache, it has no such algorithm for the REGISTRY content.  Peek into HKLM at the RadeCache space and you can potentially see registry content supporting MANY versions of old applications.

Here’s the execution space on the machine I am using to write this post.

Notice in my case, I’m on version “5” of the execution Target 1b3… which happens to be Microsoft Office 2007, the Vista/Win 7 execution target as published in the internal “showcase” at Citrix.  Also notice that there is no “4” because I have a strange habbit of formatting my primary development box once a month whether it needs it or not and the admin hasn’t updated the profile since my last reload.  I also know that our showcase admin occasionally does admin magic to delete these old spaces, but that is getting away from the purpose of this post.

Real customers

Heard from the field a couple months ago of a customer who had taken RADE to true heart; updating applications almost daily and then streaming them to server.  After a few months, they were in the hundreds in the versioning, and while this worked fine, the registry had become polluted with all the old versions.  Notice that the file system was fine, the old versions had aged themselves out of the cache and been erased, but the registry was littered with stuff that should not be there.


One can effectively and easily argue that the Streaming Service should observe application updates and when nobody remains using the old versions, it could happily perform house cleaning to purge out the not needed information from the installation image registry.  This would be a very good argument and I’d stand up and say, you are right, which is what happened with this customer.  Things like Rollback to earlier versions makes this more complicated, but in the general sense, managing this registry space should be no different than managing file system space.  It is more difficult though because for file system, there’s an advantage that anything you erase by mistake, will automatically be put back if it is needed.   For registry, it’s populated once and left alone.

To “solve” the problem, I coded a little utility to prune the registry cache.  It runs outside the confines of the streaming service and defaults to “keep 2”, to enable rollback.  The SOURCE code for this utility has been posted to the Citrix Developer Network, MyCitrix account required to get in.

One can imagine a day where this function is part of the streaming service.  I imagine that day too.  Until utopia arrives, if you need to programatically prune the registry cache, this utiltiy can help.  Set it up to run once a day/week and it will keep your registry space clean.  The UI is pretty primitive, it shows to stdout a before and after record of all of the space in the RadeCache along with indicator of stuff that it erased.

What it doesn’t do

The utility scans the registry content, observes all of the cache space and then recursively deletes the “old” entries.  What it doesn’t do is know which GUIDs are orphans, supporting applications that are no longer published.  Interestingly, the streaming service also doesn’t know which entries are no longer used.  It would be a worthy addition to also reference the “last access time” information and purge items that are over a limit.  Here, shelling to the RadeCache utility to perform the erase would be the correct action so that the official tool could be used to purge our the execution cache, both file system and registry.


Joe Nord

Product Architect – Application Streaming

Citrix Systems