Tuesday, November 6, 2007

Disposable Windows SharePoint Services Objects and Coding Techniques

Frequently, developers call the object model to manipulate data but they don't dipose the object after use it and this may cause unusal behaviors.

  • Frequent recycles of the Microsoft Windows SharePoint Services application pool, especially during peak usage
  • Application crashes that appear as heap corruption in the debugger
  • High memory use for Microsoft Internet Information Services (IIS) worker processes
  • Poor system and application performance

Coding Techniques
You can take advantage of certain coding techniques to ensure that objects are disposed of. These techniques include using the following in your code:

  • using clause
  • try, catch, and finally blocks
  • to retuce Long-Term Object Retention

    [Code Example]


If you want to see more, refer to the SDK.
Remember SDK is your friend near by you always.


------ [Korean] ------
Disposable 가능한 Windows SharePoint Services Objects 과 코딩 기술

SharePoint 개발에 대한 번역서가 없어서인지 국내 SharePoint 개발자들!!! 애로사항이 많습니다. 그리고 돌아다니는 코드 중에 SPSite 와 SPWeb 을 죽여주는 로직이 없는데, 그게 안 좋은 것이라고 MS 가 그러네요... 간단히 List 만 접근하려고 해도 생성하는 것들인데, 특히 웹 파트 등에서 생성하면 꼭 죽여야하고 안 죽이면 불이익?을 당한다는 소리도 있습니다. 저도 왠지 경험한 듯한 기억이 있습니다. 제가 아닌 누군가에 의해... ㅠㅠ 교육을 시켜야할 듯...여튼, 자세한 내용은 당근 SDK 에 있습니다.

  • 잦은 회수, 특히 바쁠때...
  • Debugger 에서의 힙 악영향?, 어플리케이션 충돌 (이거!!!)
  • IIS Process 의 많은 메모리 사용
  • 시스템이 불안하고 성능이 떨어짐

코드 기술은 위를 참조하세요~

No comments: