Using Disposable Windows SharePoint Services Objects
During my last project on MS CRM 4.0, I had to integrate SharePoint and MSCRM. This majorly involved creation of a web part for data analysis. During the development, I encountered scenarios facing long term retention of share point objects in memory. Memory leak is one of the major problems that can arise due to bad coding practices. Disposing the used SharePoint Objects is one of the best practices while coding in SharePoint. Here, I have explained why, how and when to dispose off the SP Objects in code. The objects in the Windows SharePoint Services 3.0 object model serve as an interface for working with Windows SharePoint Services data. The developers frequently call into the object model to read data from or write new data to the Windows SharePoint Services store. The Windows SharePoint Services object model contains objects that implement the IDisposable interface. One must take precautions when using these objects to avoid their long-term retention in memory in the Microsoft ....