Fody/Fody — pull request #76 by pysco68 (2013-07-17 12:46:33+00:00)
Title: Fixed memory leak by ensuring cross appdomain remoting references get de...

...stroyed

Any MarshalByRefObject descendant which returns “null” as the return from their InitializeLifetimeService() will cause a permanent reference to be held open by some fairly low level area in the .NET remoting stack, specifically System.Runtime.Remoting.ServerIdentity (which is marked internal). This was preventing InnerWeaver from being garbage collected, and thus the memory footprint would keep growing and growing.

Another way to deal with this would be to implenent ISponsor, but this becomes easily messier than this fairly clean solution IMO.

My issue was that my IDE/Fody would consequently run out of memory after a few builds of one of my bigger projects (a 20ish solutions) because of Cecil reference dictionaries not getting unloaded (a 60mb of junk per build roughly)