SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a web part that loops through web apps, sites, and webs. I'm using DoesUserHavePermissions() to check whether or not the user has access to the site. I'm getting an error and I've made sure to dispose of any SPWebs and SPSites.

Is there a tool that I can use to check where the memory leak is happening?

share|improve this question
up vote 2 down vote accepted

Have you tried MS SharePoint disposal checker tool?

share|improve this answer

Hope this help you out

In this article describes the best practices as well SharePoint dispose checker tool.

share|improve this answer

If you leak SPRequests (SPSite/SPWeb) in a Web Part then it'll listed in the ULS log (Use ULSviewer) to see that.

You can get more information about where the leak occured by setting CollectSPRequestAllocationCallStacks of the ContentService to true see SPRequest allocation callstack logging in SharePoint 2010 and WSS 4.0

share|improve this answer

Use SharePoint Code Check (SPCop - formerly known as SPDisposeCheck). This analyses memory leaks as well as controls (.ascx), pages (.aspx) and master pages (.master), stylesheets (.css), and JavaScript (.js). It works for SharePoint 2007 and higher.

This is the free component of the SharePoint Code Analysis Framework (SPCAF), which if you have the cash also provides reports, analyzers and more to test for and improve the quality of SharePoint custom development. I haven't used this so can't vouch for it.

share|improve this answer

Below link will show you the Easiest way for installing and using Dispose checker Tool

Also there are various reasons for performance issues and larger page load times.Check out the below link to see if you are Implementing all the below mentioned points

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.