Our Code

SharePoint Dispose Checker Tool

By Andreas Finne
Thursday, September 9, 2010
Posted in Apps
Tags: ,

When using the SharePoint object model, it is important to properly dispose of instantiated objects of certain classes to avoid memory leaks. The most common objects that need to be disposed are SPSite and SPWeb. However, there are certain situations where it is not obvious that an instance is even created.

The SharePoint Dispose Checker Tool checks your assemblies against the dispose patterns listed in Roger Lamb’s SharePoint Developer Blog to check whether any of the patterns are in your code without being disposed.

The tool is run from the command prompt with your assembly as argument, or alternatively, a path to a folder containing several assemblies. If the PDB-files are in the same folder, the output will include additional source information about the problems detected.

Check it out at http://code.msdn.microsoft.com/SPDisposeCheck



Leave a reply