Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
add comment

5 Answers

up vote 2 down vote accepted

Have you tried MS SharePoint disposal checker tool? http://archive.msdn.microsoft.com/SPDisposeCheck

share|improve this answer
add comment

Hope this help you out

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

http://angler.wordpress.com/2011/06/20/detecting-memory-leaks-in-sharepoint-2010/

share|improve this answer
add comment

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
add comment

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
add comment

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

http://sharepointhangout.com/easy-stepshow-to-use-sharepoint-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

http://sharepointhangout.com/top-6-reasons-why-sharepoint-performance-is-slow/

share|improve this answer
add comment

Your Answer

 
discard

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.