This is a migrated thread and some comments may be shown as answers.

Rad Editor Lite Does Not Pass SPDisposeCheck

13 Answers 116 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Connie
Top achievements
Rank 1
Connie asked on 20 Apr 2009, 10:01 AM
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

13 Answers, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 22 Apr 2009, 06:48 AM
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.
0
Connie
Top achievements
Rank 1
answered on 07 May 2009, 10:05 AM

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

0
Stanimir
Telerik team
answered on 11 May 2009, 10:15 AM
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.
0
Stefan Reichling
Top achievements
Rank 1
answered on 10 Aug 2009, 12:20 PM
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.
0
Lini
Telerik team
answered on 13 Aug 2009, 10:51 AM
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.
0
Martin
Top achievements
Rank 1
answered on 25 Nov 2009, 01:07 PM
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


0
Lini
Telerik team
answered on 30 Nov 2009, 03:14 PM
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.
0
Martin
Top achievements
Rank 1
answered on 30 Nov 2009, 04:21 PM
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
0
Lini
Telerik team
answered on 01 Dec 2009, 07:36 AM
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.
0
Derek Smay
Top achievements
Rank 1
answered on 30 Apr 2010, 03:45 PM
Any updates to this ? I download latest RadEditor for Moss and SP DisposeChecker still displays these errors.
0
Lini
Telerik team
answered on 05 May 2010, 11:30 AM
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.
0
Ali
Top achievements
Rank 1
answered on 19 Jul 2010, 09:21 PM
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.
0
Stanimir
Telerik team
answered on 20 Jul 2010, 09:47 AM
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.
Tags
WebParts for SharePoint
Asked by
Connie
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
Connie
Top achievements
Rank 1
Stefan Reichling
Top achievements
Rank 1
Lini
Telerik team
Martin
Top achievements
Rank 1
Derek Smay
Top achievements
Rank 1
Ali
Top achievements
Rank 1
Share this question
or