Check for Memory Leaks in your SharePoint API Code

 

Microsoft has just released a memory leak checker for SharePoint code. Not sure if all your SPWeb and SPSite objects have been properly disposed? Use this tool to discover which lines of your code are not properly disposing of those objects.

 

Each SPWeb and SPSite object takes 1-2 megs of unmanaged memory. So no properly disposing of them causes major memory leaks. However, (this is important) if you dispose of a SPSite object that you get from SPContext.Current, you will crash your SharePoint site. So having a tool that you can run to definitively determine if your production code is good, is a big help.

 

-Joseph

Comments

Popular posts from this blog

How to Create and Run Tableau Bridge on Linux Containers

RAM Disks do not speed up Visual Studio

Outlook tip: Turn off Email Contact Pictures