Here's a bunch of them:
- Roger Lamb's blog - SharePoint 2007 and WSS 3.0 Dispose Patterns
- WhitePaper from Microsoft - Best Practices: Using Disposable Windows SharePoint Services Objects
No matter how well you know these rules there are times when your brain will temporary forget about them. There are also scenarios that can be a bit tricky to recognize as a "dispose scenario".
One example of the latter is when using the indexer on a SPSiteColletion for instance, see this article for details:
One great thing about being a developer on the 20th century (apart from the Internet - thank you mr Lee!) are the Open Source projects and utilities out there.
SPDisposeChecker is such a utility that should be part of every SharePoint developers toolbox.
It helps you analyze your assemblies and points out memory leak patterns before your customer/manager calls you up Friday afternoon.
Read more about the utility and download it here:
Kudos to the SPDisposeChecker team!
And the soundtrack for this post?
L'homme propose, Dieu dispose (Man proposes, God disposes)
No comments:
Post a Comment