UPDATED 2010-10-17 The Dispose() methods of SharePoint objects (SPSite and SPWeb) are one of the important things us developers have to deal with. Many of the SharePoint methods allocate memory not released by garbage collector causing inumerous problems in our applications Microsoft has published a MSDN whitepaper(http://msdn.microsoft.com/en-us/library/aa973248.aspx) by Mike Ammerlaan and Scott Harris, with some guidance and Roger Lamb provides continuous additional details and discussion on his MSDN SharePoint Developer blog(http://blogs.msdn.com/rogerla/default.aspx). To solved some of this problems, Microsoft released SPDisposeCheck Tool (command line tool) SPDisposeCheck is a tool to help us to check your assemblies that use the SharePoint API so that we can build better code. SPDisposeCheck.exe takes the path to a managed .DLL or .EXE or the path to a directory containing many managed assemblies.
In addition to that , the SharePoint Portuguese User Group wants to help out and because of it , i've developed one AddIn that wraps the SPDisposeCheck Tool from Microsoft and fully integrate it with Visual Studio.
The addin works in Vs2008, Vs2010 and SharePoint 2007 and SharePoint 2010 You can download the Microsoft SPDisposeCheck Tool from here:http://code.msdn.microsoft.com/SPDisposeCheck The Addin from here:http://spugpt.codeplex.com/releases/view/43092#DownloadId=158433 And a couple of examples from here http://spugpt.codeplex.com/releases/view/43092#DownloadId=115297 Also i made available a small video. You can watch it here:http://www.youtube.com/watch?v=VS4RcibZKJw
Rodrigo Pinto (Scoutman) |