I’ve just finished helping on a case where a fairly simple usage scenario for the IIS ADSI provider ran into a memory leak. A lot of the time this would not matter as the ADSI programming interface to IIS is often used from short lived scripting clients so a memory leak may not even be noticed, let alone be a problem. However in this case my customer was using it from an application that ran 24×7 to monitor IIS configuration so the leak became very apparent after a fairly short time.
As a result, we now have a new hotfix generally available for the Windows 7 and Windows Server 2008 R2 platforms:
The article gives a simple code sample that demonstrates the leak. Essentially all you have to do is bind to a virtual directory object and enumerate all its properties.