We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Chart not released ?

Thread ID:

Created:

Updated:

Platform:

Replies:

90236 Sep 23,2009 03:04 AM Dec 24,2012 05:46 AM WPF 12
loading
Tags: Chart
Frederic Mory
Asked On September 23, 2009 03:04 AM

Hello,

I have an application that use use homemade MDI windows system and is hosted in xbap. MDI child are usercontrol and when i close my MDI child, the usercontrol is no more referenced.
Now when i create a chart (just the chart without datasource) inside MDI Child and then i close the MDI child, my usercontrol is still referenced by the chart.
I used Memory Profiler to watch if a suspect event could be the reason and actually there is an event referencing Chart wich is never released.

Here is what i have :

Namespace Name
Syncfusion.Windows.Chart Chart
^
|
| referenced by
|
|
Namespace Name
System EventHandler #257,306._target

The allocation stack is showing for this EventHandler :
Chart.RegisterEventForClose()
Chart.Chart_Loaded(object, RoutedEventArgs)
RoutedEventHandlerInfo.InvokeHandler(object, RoutedEventArgs)
RouteItem.InvokeHandler(RoutedEventArgs)
....

It seems that Chart.RegisterEventForClose() eventhandler is created in Loaded method of chart.

Now i use Reflector to find out what it means :
//
private void RegisterEventForClose()

{
Window window = (Window) VisualUtils.FindSomeParent(this, typeof(Window));
if (window != null)
{
window.Closed += new EventHandler(this.OnApplicationClosed);
}
else
{
Page page = (Page) VisualUtils.FindSomeParent(this, typeof(Page));
if (page != null)
{
page.Unloaded += new RoutedEventHandler(this.OnApplicationClosed);
}
}
}
//

Okay for me that means that an Chart.OnApplicationClosed will be fired on the Unloaded of the Page control (in my case because i use XBAP)

Now let's see Chart.OnApplicationClosed :

//
private void OnApplicationClosed(object sender, EventArgs e)
{
if (this.propertyItem != null)
{
this.isChartClose = true;
this.propertyItem.Close();
}
}
//
It seems that OnApplicationsClosed is necessary to clean Chart and release it (?)


The problem seems to be in RegisterEventForClose() : my whole XBAP application is hosted in a Page. The Page is never quited until i close application. So OnApplicationClosed is never fired until i close the application. That means all charts remain unfortunately in memory during the lifetime of the application.


1) Could you confirm what i describe ?
2) Could you suggest an implementation or a workaround to release Charts on unload of my usercontrol?

Best regards,
FMO

Poorani Idhaya Bala M.A [Syncfusion]
Replied On September 24, 2009 09:12 AM

Hi,

Thank you for your interest in Syncfusion products.

We got your requirement,We are working on this and will get you an update soon.

Thanks,
Poorani

Frederic Mory
Replied On October 6, 2009 07:33 AM

Hello,

Any news about this issue ?

I hope at least a fix will be included in next release, we really need it for our application in production environment.

Regards,
FMO

Poorani Idhaya Bala M.A [Syncfusion]
Replied On October 7, 2009 03:07 AM


Hi,

Thanks for your patience.

Sorry for the delaying update. We are glad to inform you that the issue which “Chart not released” has been fixed and it will include in our vol4 release which is Scheduled on October 22.

Thanks for choosing Syncfusion Products.

Please let us know if you have any other further queries.

Thanks,
Poorani

Frederic Mory
Replied On October 8, 2009 02:50 AM

Very good thing !

Thanks for your support.

Regards,
FMO

Poorani Idhaya Bala M.A [Syncfusion]
Replied On October 8, 2009 06:57 AM

Hi,

Thank you. We will update you once our product is released.

Thanks for choosing Syncfusion Products.

Thanks,
Poorani

Poorani Idhaya Bala M.A [Syncfusion]
Replied On October 12, 2009 07:51 AM

Hi,

Thanks for choosing Syncfusion Products.

If you need assemblies with this fix, kindly create new incident in our direct-trac system so that we can update you with custom assemblies with this fix. Also We have noticed you've submitted a number of specific technical inquiries here in the Forums which seem to indicate you are a current customer rather than an evaluator or tester. If so, you might like to know that you have an existing personal Direct-Trac account available using your own email address, and we highly recommend using your personal account. You'll get a faster response along with an automatic update when your question is answered via DirectTrac, and you can login and view your incident history 24x7.

Simply visit
https://www.syncfusion.com/Support/DirectTrac/logon.aspx?URL=/Support/DirectTrac/default.aspx to login.

If you have any further questions, we hope you will take advantage of your existing account and available services as a license holder.

Please let us know if you have any questions.

Thanks,
Poorani

Frederic Mory
Replied On October 12, 2009 10:28 AM

Hi,

You should receive a new ticket in a moment by our developer (i'm not ;)) on Direct Track.

Regards,
FMO

Poorani Idhaya Bala M.A [Syncfusion]
Replied On October 13, 2009 01:12 AM

Hi,

Thanks for opening Direct Trac account. We have updated the custom assemblies in Direct Trac.

Let us know if you have any questions.

Thanks for choosing Syncfusion Products.

Thanks,
Poorani


Frederic Mory
Replied On October 13, 2009 03:29 AM

Hello,

Charts are now well released when my UserControl dont reference them anymore.

Thank you for your Premium support !

Regards,
FMO

Poorani Idhaya Bala M.A [Syncfusion]
Replied On October 14, 2009 05:37 AM

Hi,

Thanks for choosing Syncfusion products.

We are glad to hear that your problem has been resolved. Please do not hesitate to contact us if you ever need further assistance from us.

Please let us know if you have any queries.

Thanks,
Poorani

Bouchind'homme Franck
Replied On December 21, 2012 09:52 AM

I'm evaluating the WPF Essential Chart and looks like that the chart is not released either.
 
On different vendor product i :
- Instanciate a chart class
- Add the chart to the visual
- Create on it some serie
- Remove it from the visual
- nullates the reference
- call GC.collect()
 
And Syncfusion is the only one not releasing its data, and Syncfusion consumes a lot of it.
 
What should i do to severe any reference to the chart so GC can free it ?
 
I tryed MemProfiler and CLRProfiler to figure out but no luck :
- When my chart is instanciated CLRPRofiler shows my class member reference pointing to it
- When i remove it form visual and put my class member reference to null it looks like that some Generic Dictionnary is now referencing the Chart.ChartArea and prevent freeing the chart
 
My application is a simple base WPF one and joined to the post.


EvaluationGrapheur.Syncfusion_9ce8695.zip

Michael Prabhu M [Syncfusion]
Replied On December 24, 2012 05:46 AM

Hi,

Thanks for using Syncfusion Products,

We have analyzed your sample and we like to inform you that there is a property called "DisposeOnUnload" in Chart which has to be set to true in order to clear the memory leak. We have modified the sample as per your requirement and it can be downloaded from the link below.

If you still face the problem can you please open a Direct Track incident along with the version details of the Chart so that we can provide patch accordingly.

Please let us know if you need further clarifications.

Thanks,

Michael Prabhu.



EvaluationGrapheur.Syncfusion_2502521e.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;