One of the areas covered during the training I do on WSS Development is how to correctly dispose of objects, specifically the the ones that have a reference to SPRequest like SPSite and SPWeb. We talk about performance tuning but don’t really get deep down into how tuning the IIS worker process actually works.
Over the past few months there has been a marked improvement in the information being blogged on the subject so I thought it useful, as a personal reference, but also to help future students and readers of my blog to list them here.
Microsoft – Best Practices: Using Disposable Windows SharePoint Services Objects
Learn the appropriate ways to write your code when using Microsoft Windows SharePoint Services objects so that you can avoid retaining the objects in memory with the Microsoft .NET Framework
http://msdn2.microsoft.com/en-us/library/aa973248.aspx
Roger Lamb’s SharePoint Developer Blog
Roger has taken the original article and extended this, he gives lots of examples of the right and wrong ways to code – you may spot some of yours in here
He also documents the PublishingWeb object as another example that users the SPRequest object.
Stefan Goßner – Dealing with memory Pressure problems in MOSS/WSS
Stefan gives a very detailed insight into how memory is consumed and what’s happening inside the memory for the w3wp.exe process. The reasons we have memory pressure and tips on how to resolve this.
Steve Sheppard – Overlapped Recycling And SharePoint: Why SharePoint Requires it
Steve explains why he thinks that SharePoint needs the safety net provided by overlapping recycling. If you not sure what that means read the blog
One of the things that we all should take from this is that when we move to the 64Bit environment most of these challenges will become much less of an issue. It does not mean we don’t need to code properly, just that we will have a bit more room to move.
So for all of you that are thinking how do I move from 32bit to 64bit? well Steve Smith and Penny Coventry have published a great white paper on this very subject.







