SharePoint and objects disposal, the definitive guide!

One of those difficult things to handle in the construction of SharePoint related code is the cleaning up of used objects. The problem is that if you don't clean up your mess, the garbage collector does its job, and nothing really bad seems to happen. Problems only occur when your site is on heavy load in the production environment, and you have no clue how to solve that problem where your processor hits the 100% and used memory goes sky high.

Finally there is a great article out there that explains in great detail the best programming practices with SharePoint objects. Go grab it and start reviewing your code!

Article: Best Practices: Using Disposable Windows SharePoint Services Objects

Blog post with further discussions: http://blogs.msdn.com/krichie/archive/2006/06/15/632611.aspx

No Comments