Rad Editor Lite Does Not Pass SPDisposeCheck

14 posts, 0 answers
  1. Connie
    Connie avatar
    2 posts
    Member since:
    Jul 2008

    Posted 20 Apr 2009 Link to this post

    We are using RadEditor LIte on SharePoint/MOSS 2007.  When checking for memory leaks with SPDisposeCheck, RadEditor is listed as not disposing of all its memory.  Is this a false positive?  We are on version 4.5.3.0 but checked the dll for the newer version, and it still does not pass the SPDisposeCheck. 

    Thanks, Connie

  2. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 22 Apr 2009 Link to this post

    Hi Connie,

    Could you please inform us exactly, which latest dll have you been testing. Is it the one that comes with the lite version of RadEditor for MOSS 4.5.6 or the ASP.NET AJAX RadEditor for MOSS 5.4.0?

    Some additional information regarding the test and its results will be helpful as well.

    Thank you.


    Sincerely yours,
    Stanimir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

  3. Connie
    Connie avatar
    2 posts
    Member since:
    Jul 2008

    Posted 07 May 2009 Link to this post

    Information on the results obtained by using the SPDisposeCheck:

    Note: This tool may report errors which are not actually memory leaks, otherwise known as false positives.

    Further investigation should be done to identify and correct real errors.

    It is designed to assist developers in making sure their code adheres to best practices for memory allocation when using SharePoint APIs.

    Please see the following for more information:

    http://blogs.msdn.com/rogerla/

    http://msdn2.microsoft.com/en-us/library/aa973248.aspx

    http://msdn2.microsoft.com/en-us/library/bb687949.aspx

    ----------------------------------------------------------

     

     

    ID: SPDisposeCheckID_110

    Module: RadEditorSharePoint.dll

    Method: Telerik.SharePoint.SharePointContext.InitContext(System.Web.HttpContext,System.String,System.String,System.String)

    Statement: local0 := new Microsoft.SharePoint.SPSite(siteUrl)

    Notes:  Disposable type not disposed: Microsoft.SharePoint.SPSite

                     ***This may be a false positive depending on how the type was created or if it is disposed outside the current scope

    More Information: http://blogs.msdn.com/rogerla/archive/2008/02/12/sharepoint-2007-and-wss-3-0-dispose-patterns-by-example.aspx#SPDisposeCheckID_110

    ----------------------------------------------------------

     

     

    ID: SPDisposeCheckID_120

    Module: RadEditorSharePoint.dll

    Method: Telerik.SharePoint.SharePointContext.InitContext(System.Web.HttpContext,System.String,System.String,System.String)

    Statement: local1 := local0.{Microsoft.SharePoint.SPSite}OpenWeb(webUrl)

    Notes:  Disposable type not disposed: Microsoft.SharePoint.SPWeb

                     ***This may be a false positive depending on how the type was created or if it is disposed outside the current scope

    More Information: http://blogs.msdn.com/rogerla/archive/2008/02/12/sharepoint-2007-and-wss-3-0-dispose-patterns-by-example.aspx#SPDisposeCheckID_120

    ----------------------------------------------------------

     

     

    ID: SPDisposeCheckID_120

    Module: RadEditorSharePoint.dll

    Method: Telerik.SharePoint.SharePointContext.SwitchToPersonalSite

    Statement: local2 := this._contextWeb.{Microsoft.SharePoint.SPWeb}get_Site().{Microsoft.SharePoint.SPSite}OpenWeb(System.String.Concat("/personal/", local0))

    Notes:  Disposable type not disposed: Microsoft.SharePoint.SPWeb

                     ***This may be a false positive depending on how the type was created or if it is disposed outside the current scope

    More Information: http://blogs.msdn.com/rogerla/archive/2008/02/12/sharepoint-2007-and-wss-3-0-dispose-patterns-by-example.aspx#SPDisposeCheckID_120

    ----------------------------------------------------------

     

    Total Found: 3

     

    ----------------------------------------------------------

     

    Modules Checked: 1

    ----------------------------------------------------------

    RadEditorSharePoint.dll

    ----------------------------------------------------------

     

    Modules Ignored: 0

    ----------------------------------------------------------

    ----------------------------------------------------------

     

    Methods Ignored: 0

  4. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 11 May 2009 Link to this post

    Hi Connie,

    Thank you for the provided information. It is very helpful indeed. I logged this issue in our bug-tracking system, so our developers will decide what action should be taken on the matter. Unfortunately I can not give you estimation of when this will be resolved.


    All the best,
    Stanimir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Stefan Reichling
    Stefan Reichling avatar
    1 posts
    Member since:
    Aug 2009

    Posted 10 Aug 2009 Link to this post

    Is there any new information regarding this issue?
    I recently downloaded RadEditorLite Version RadEditorMOSS_4_5_6. The RadEditorSharePoint.dll still throws the three described errors during dispose check.
  6. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 13 Aug 2009 Link to this post

    Hello,

    The current RadEditor for MOSS free release (4.56) was released in April 2009. At the moment, we have no plans to release an official update for that release. That being said, I have compiled a new build of the 4.56 RadEditorSharePoint.dll. You can try replacing the copy in your server's GAC with the attached file. Here is what is changed:

    1. SwitchToPersonalSite() method is not used anywhere in our code and is left only for backwards compatibility with 3rd party solutions that use our editor. It has now been marked obsolete.

    2. The SharePointContext class now implements IDisposable so it will properly dispose the SPSite and SPWeb objects created in InitContext().

    Regards,
    Lini
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. Martin
    Martin avatar
    6 posts
    Member since:
    Oct 2009

    Posted 25 Nov 2009 Link to this post

    Hi,

    using your new build, I still get 2 problems reported:

    ID: SPDisposeCheckID_110
    Module: RadEditorSharePoint.dll
    Method: Telerik.SharePoint.SharePointContext.InitContext(System.Web.HttpContext,System.String,System.String,System.String)
    Statement: local0 := new Microsoft.SharePoint.SPSite(siteUrl)
    Notes:   Disposable type not disposed: Microsoft.SharePoint.SPSite
      ***This may be a false positive depending on how the type was created or if it is disposed outside the current scope
    More Information: http://blogs.msdn.com/rogerla/archive/2008/02/12/sharepoint-2007-and-wss-3-0-dispose-patterns-by-example.aspx#SPDisposeCheckID_110
    ----------------------------------------------------------

    ID: SPDisposeCheckID_120
    Module: RadEditorSharePoint.dll
    Method: Telerik.SharePoint.SharePointContext.InitContext(System.Web.HttpContext,System.String,System.String,System.String)
    Statement: local1 := local0.{Microsoft.SharePoint.SPSite}OpenWeb(webUrl)
    Notes:   Disposable type not disposed: Microsoft.SharePoint.SPWeb
      ***This may be a false positive depending on how the type was created or if it is disposed outside the current scope
    More Information: http://blogs.msdn.com/rogerla/archive/2008/02/12/sharepoint-2007-and-wss-3-0-dispose-patterns-by-example.aspx#SPDisposeCheckID_120
    ----------------------------------------------------------

    Total Found: 2

    ----------------------------------------------------------

    Modules Checked: 1
    ----------------------------------------------------------
    radeditorsharepoint.dll
    ----------------------------------------------------------

    Modules Ignored: 0
    ----------------------------------------------------------
    ----------------------------------------------------------

    Methods Ignored: 0
    ----------------------------------------------------------

    Just implementing IDisposable doesn't seem to do the trick. You must enclose object creation in "using" blocks, such as this:

    using (Microsoft.SharePoint.SPSite mySite = new Microsoft.SharePoint.SPSite(siteUrl))
    {
        ...
        using (Microsoft.SharePoint.SPWeb myWeb = mySite.OpenWeb(webUrl))
        {
            ...
        }
        ...
    }

    I would love to use the RadEditor Lite for MOSS but this memory leak is a serious problem. Would there be any way to get this fixed?

    Thank you


  8. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 30 Nov 2009 Link to this post

    Hi Martin,

    I am not sure if there is an easy way to fix the remaining two issues. The problem is that they are stored in a static instance, which is accessed from different parts of the editor code multiple times, so we can't really know when we should dispose them.

    I added a destructor to the Telerik.SharePoint.SharePointContext class and I am attaching the updated assembly here (RadEditorSharePoint.dll , ver 4.56). However, I don't think that the .NET GC will touch it until the web application exits.

    Best wishes,
    Lini
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. Martin
    Martin avatar
    6 posts
    Member since:
    Oct 2009

    Posted 30 Nov 2009 Link to this post

    Thank you Lini, I can see the problem. I wonder if in the scenario you describe we actually have a memory problem. This should depend on how often new instances of SPSite and SPWeb are created. For example, will a new instance be created each time a user accesses a web page that uses the editor, or are the instances shared among different requests, pages or even users? Knowing this, I'd be happy to run a simulation to see what happens to memory.

    Best, Martin
  10. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 01 Dec 2009 Link to this post

    Hi Martin,

    The problematic instances of the SharePointContext class should be created only when the use opens an editor file browser dialog (document manager, image manager, etc.). This applies only to the built-in RadEditor dialogs and not the MOSS 2007 Asset Picker dialog. The instance is not shared between requests because it is stored in the Context object.

    Greetings,
    Lini
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  11. Derek Smay
    Derek Smay avatar
    1 posts
    Member since:
    Jul 2012

    Posted 30 Apr 2010 Link to this post

    Any updates to this ? I download latest RadEditor for Moss and SP DisposeChecker still displays these errors.
  12. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 05 May 2010 Link to this post

    Hello,

    If you are using the ASP.NET AJAX version of the editor, you can safely ignore the SP DisposeChecker warnings - we have changed the code to dispose all SPWeb and SPSite instances properly. The warnings still come up, because the objects are disposed in a different scope.

    If you are using the Lite MOSS editor, please use the RadEditorSharePoint assembly I posted a few messages back.

    All the best,
    Lini
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  13. Ali
    Ali avatar
    1 posts
    Member since:
    Jul 2010

    Posted 19 Jul 2010 Link to this post

    I get 3 errors reported by previous users. I have big site collections where I use your web part. My ULS logs are getting bigger everytime I check them and I made sure that the code I have made myself has no leaks. I need to remove these memory leak errors from ULS log and need to make sure that whatever I use is error free and follows best practices. Is there any release for that bug? The latest provided by you has 2 bugs, I suppose that still hasn't solved the problem yet.

    Thanks.
  14. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 20 Jul 2010 Link to this post

    Hi Ali,

    The current RadEditor for MOSS free release (4.56) was released in April 2009. At the moment, we have no plans to release an official update for that release.

    Sincerely yours,
    Stanimir
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top