I was recently struggling with a memory leak somewhere in my code. My code which was running in the _LAYOUTS directory was handling content types across sites/lists in a SharePoint configuration.
On my local machine with a small number of lists/sites everything appeared to be fine, but when running on a test server I could see the memory in use on the server to jump up by several MB every couple of seconds. After a few minutes the memory on the server could be up to a over a GB. Eventually an OutOfMemory exception would be thrown.
I pulled all my code apart and ran some profiling tools to find the problem and it turned out to be an SPWeb which was being created and not being closed (unbeknown to me). So it was an easy solution once found.
I found this MSDN link very useful while looking into this and thought it would be worth highlighting for any developers working with SharePoint:
http://msdn.microsoft.com/en-us/library/aa973248.aspx
I think I’m in the same situation. Do you remember what code caused the SPWeb to be instantiated?
Hi,
Even I too was working on Sharepoint and faced quite a few issues with the Sharepoint memory leaks.
I have listed out all our production issues and put forth for the users so that the same wouldnt happen with any one.
URL: http://krishnabunnyvalidspuser.blogspot.com/2010/08/memory-leaks-in-sharepoint.html
In case you require more info just comment on the post so that i would reply on this.
Hi,
Can you please say what profiling tools you used to find out the problem?
Thanks.
F*ckin? tremendous issues here. I am very glad to see your article. Thank you a lot and i’m looking forward to contact you. Will you kindly drop me a e-mail?