Leak Found in the .NET XmlSerializer

We finally found another leak in our Citrix WinForms app.  Early tests show this one to be huge, so we are optimistic that this will clear up most of our problems.  Apparently the XmlSerializer creates dynamic assemblies, but they only get reused if you stick to the simplist constructors.  We are using one of the more complex constructors, so we were essentially leaking dynamic assemblies since .net provides no way to remove assemblies from an AppDomain.  I can't take credit for finding the problem, one of my colleagues here did that, but I found the solution -- just create it once and reuse it.  Its also interesting to note that now that I know what to look for, its easy to find other people that have ran into this before, like Joseph Cooney and Scott Hanselman.

3 Comments

Comments have been disabled for this content.