Sharepoint 2010 Memory Leaks

Leave a comment

June 28, 2012 by Ruaan Harmzen

You ever wonder why your Sharepoint environment sometimes just suddenly starts pumping out correlation ids?

One of the causes could be some memory leaks in your environment and this typically is caused by custom developed web parts. You are a bit safer with sand boxed solutions, however they also do tend to give problems.

Sharepoint is complex by nature and development in Sharepoint even more. If you do not properly dispose of the objects you use in code it will lead to memory leaks. It does not matter how good you are at coding, it is very easy to miss where to dispose objects in Sharepoint.

The solution is simple. Download the SPDisposeCheck tool from Microsoft and run against your customer Sharepoint code. It installs to the Tools menu of Visual Studio. It has some basic settings as shown below (I suggest you run it ad-hoc when you are ready to deploy and not on every build)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: