mailprint
 Thursday, June 22, 2006

Using Disposable WSS Objects

Scott Harris and Maike Ammerlaan wrote a MSDN article about how to use disposable WSS objects. A very usefull article that shows that you cannot always rely on the garbage collector to release objects quickly. A must read for every SharePoint developer!

“Several of the Windows SharePoint Services objects, primarily the SPSite class and SPWeb class 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 garbage collector, the garbage collector does not release the object from memory in a timely manner. The object's use of a large amount of unmanaged memory can cause some of the unusual behaviors described earlier. Calling applications that work with IDisposable objects in Windows SharePoint Services must dispose of the objects when the applications finish using them. You should not rely on the garbage collector to release them from memory automatically.”

read the complete article


Thursday, June 22, 2006 10:48:51 AM UTC   #   Comments [0]
.Net | Sharepoint


Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

 
© Copyright 2008, Mart Muller