Saturday 31 January 2009

Go and download SPDisposeCheck !

If you are into WSS 3.0 and MOSS 2007 custom development go and download the SharePoint Dispose Checker Tool (aka SPDisposeCheck) -
http://code.msdn.microsoft.com/SPDisposeCheck

Announced by Paul Andrew at Microsoft -
http://blogs.msdn.com/pandrew/archive/2009/01/29/spdisposecheck-v1-3-1-is-released.aspx

Proper disposal of SharePoint objects in custom code is very important. If you are causing memory leaks you will create memory pressure problems in production Farms, which can result in serious side affects and system downtime.

1 comment:

Anonymous said...

Hey Sezai,

Like you I've used this tool for a while in earlier versions. I'd like to point out to others that it is only a guide and is not always accurate.

Better to get in the habit of putting SPWebs & SPSites in using (or disposing in finally) clauses.

For resource reasons, I'm not a fan of ALWAYS creating a new instance when a current context already exists (or was passed by your feature receiver, event etc). If that's also you, just remember NOT to dispose those.

Mike MOSSuMS Stringfellow