SPDisposeCheck can help you find potential memory leaks. (It will give some false positives, but that’s worth it to me.)
Tool Description
SharePoint 2010 Dispose Checker Tool
- SPDisposeCheck is a tool to help you to check your assemblies that use the SharePoint API so that you can build better code. It provides assistance in correctly disposing of certain SharePoint objects to help you follow published best practice. This tool may not show all memory leaks in your code. Further investigation is advised if you continue to experience issues. New features in this release include VS 2008 and 2008 add-in, added “Do Not Dispose Rules”, bug fixes, and updated for WSS 3.0 / MOSS 2007 and SPF / SharePoint Server 2010.