Export (0) Print
Expand All

Memory Management for SharePoint Objects

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Windows SharePoint Services objects, including SPSite objects and SPWeb objects, are created as managed objects. However, these objects use unmanaged code and memory to perform the majority of their work. The managed part of the object is small; the unmanaged part of the object is much larger. Because the smaller managed part of the object does not put memory pressure on the .NET Framework runtime's garbage collector, the garbage collector may not release the object from memory in a timely manner. Applications that use IDisposable objects in Windows SharePoint Services must dispose of those objects when they no longer need them.

For more information about this topic, see Best Practices: Using Disposable Windows SharePoint Services Objects on MSDN and Roger Lamb's SharePoint Developer Blog.

For more information about common SharePoint coding issues, see Best Practices: Common Coding Issues When Using the SharePoint Object Model on MSDN.


Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Show:
© 2014 Microsoft