locked
Getting error "An SPRequest object was reclaimed by the garbage collector instead of being explicitly freed... " RRS feed

  • Question

  • Hi,

    I am frequently getting following error messages in my sharepoint logs

    An SPRequest object was reclaimed by the garbage collector instead of being explicitly freed.  To avoid wasting system resources, dispose of this object or its parent (such as an SPSite or SPWeb) as soon as you are done using it.  Allocation Id: {F67E26BB-7413-4105-885B-6B1398F2ECA5}  To determine where this object was allocated, create a registry key at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\HeapSettings.  Then create a new DWORD named SPRequestStackTrace with the value 1 under this key.

    Any clues how to resolve this issue ?

    Further more I have notices that these error messages are growing tremendously... I have not deployed any custom code or third party webparts on my sharepoint environment.

    Regards 


    Muhammad Tariq khan
    Monday, January 9, 2012 7:03 AM

Answers

  • Hi Muhammad,

     

    Each SPWeb and SPSite object holds a reference to an SPRequest object which holds a reference to a SharePoint COM object that is responsible to communicate with the backend SQL server. The dispose of the SPWeb and SPSite object is necessary to ensure that the SPRequest object will release the COM object and also all the memory allocated by this COM object is released.

     

    Usually you would think that if you don't add any custom code to your page that only one SPSite and one SPWeb object should be required, but this is not correct. The reason is that all the master pages contain three navigation controls: The Top navigation, the Breadcrumb control and the Left Navigation control.

     

    You can refer to the following article for better understanding of this error and how to troubleshooting it.

    http://blogs.technet.com/b/stefan_gossner/archive/2008/05/07/troubleshooting-spsite-spweb-leaks-in-wss-v3-and-moss-2007.aspx

     

    http://msdn.microsoft.com/en-us/library/ms778813.aspx

     

    Hope this helps.

     

    Thanks.


    Pengyu Zhao

    TechNet Community Support

    • Marked as answer by GuYuming Monday, February 18, 2013 8:52 AM
    Wednesday, January 11, 2012 7:42 AM

All replies

  • Hi Muhammad,

     

    Each SPWeb and SPSite object holds a reference to an SPRequest object which holds a reference to a SharePoint COM object that is responsible to communicate with the backend SQL server. The dispose of the SPWeb and SPSite object is necessary to ensure that the SPRequest object will release the COM object and also all the memory allocated by this COM object is released.

     

    Usually you would think that if you don't add any custom code to your page that only one SPSite and one SPWeb object should be required, but this is not correct. The reason is that all the master pages contain three navigation controls: The Top navigation, the Breadcrumb control and the Left Navigation control.

     

    You can refer to the following article for better understanding of this error and how to troubleshooting it.

    http://blogs.technet.com/b/stefan_gossner/archive/2008/05/07/troubleshooting-spsite-spweb-leaks-in-wss-v3-and-moss-2007.aspx

     

    http://msdn.microsoft.com/en-us/library/ms778813.aspx

     

    Hope this helps.

     

    Thanks.


    Pengyu Zhao

    TechNet Community Support

    • Marked as answer by GuYuming Monday, February 18, 2013 8:52 AM
    Wednesday, January 11, 2012 7:42 AM
  • Dear Pengyu Zhao,

    If I dont use Master Page and set my sharepoint site to default theme. Would that fix my problem ? 


    Muhammad Tariq khan
    Wednesday, January 11, 2012 8:07 AM