Dispose refers to the cleaning up of resources used by an object during its lifetime. The .NET Framework is a garbage-collected runtime, which means this happens automatically, however SharePoint has a habit of maintaining its unmanaged resources, which may result in high memory usage if disposal is ...

learn more… | top users | synonyms

1
vote
1answer
343 views

ParentWebId: Troubleshooting SPSite/SPWeb leaks in WSS v3 and MOSS 2007

Following the guidance below (1) to ensure that the stack trace of the allocation of the SPRequest object is preserved in memory and added to the ULS logs, I'm seeing a steady stream of 8l1n (High) ...
2
votes
2answers
92 views

SPDisposeChecker, is this a false positive?

We have the following code: foreach (SPWeb website in collectionOfWebSites) { // Some code, no dispose of website } SPDisposeChecker is reporting it as a memory leak. Should ...
1
vote
1answer
134 views

How to properly dispose of SP objects although not assigned?

If I assign SPContext.Current.Site.OpenWeb().Title to a string, do I need to dispose of it (if possible)? string title = SPContext.Current.Site.OpenWeb().Title; I'm still a little fuzzy on when to ...
1
vote
4answers
691 views

Does this leak? SharePoint SPSite and SPList code

Would this code cause an SPList object to leak? It's enclosed in a Using statement but that's in a sub routine. String site = "http://server/sites/site"; foreach (string s in OutputListField(GetList(...
1
vote
1answer
731 views

Memory Leak - Disposing SPSite and SPWeb?

So I read through another post here http://www.sharepointoverflow.com/questions/1047/disposal-of-spwebs-created-using-spsite-openweb. Currently I only dispose of the SPSite object, and from my ...
1
vote
1answer
477 views

Dispose SPContext.Web

Normally it is not required to dispose SPWeb when it is obtained from the current context. However what happens if I create the context on my own? SPContext spContext = SPContext.GetContext(...
6
votes
2answers
1k views

Do you have to dispose of the SPWeb in the EventReceiver when using properties.OpenWeb()?

Does properties.OpenWeb() create a new SPRequest object or does it refer to the existing SPWeb object already there in the properties object? Should we manually dispose of the SPWeb obtained in this ...
3
votes
2answers
9k views

“Potentially excessive number of SPRequest objects” coming from Microsoft's own code?

In one of my SharePoint apps, I am getting this warning & stacktrace over and over (with different GUIDS): since it's only one of my apps, I assume there's something in my project's code, but ...
2
votes
2answers
2k views

Warning of undisposed objects in Microsoft's own SharePoint code

I found many 8l1n warnings of undisposed objects in the SharePoint ULS logs. The interesting thing is that the entire stack trace does not show anything in my code. I am not sure what to look for in ...
4
votes
5answers
3k views

Disposal of SPWebs created using SPSite.OpenWeb()

After reading some answers/comments on Disposal of SPWebs retrieved from SPContext.Current.Site.AllWebs, I opened up Reflector to dig deeper into the SPSite and SPWeb classes. I ran into a surprise, ...
7
votes
3answers
4k views

Disposal of SPWebs retrieved from SPContext.Current.Site.AllWebs

As there was a minor disagreement on whether SPWebs retrieved from SPContext.Current.Site.AllWebs should be disposed, I thought it would be appropriate to post a new question and discuss it here. I ...