Jump to content
Software FX Community

Memory leak / not being released


TOPry
 Share

Recommended Posts

I am having an issue with memory allocated by the chart not being released

when the form on which the control is displayed is unloaded.

I have tried invoking the .Dispose method implicitly as well as setting the

.Datasource to nothing, with no effect.

The way I am testing this:

Create a Winforms application, on form1 place a button that shows form2

which contains the ChartFX Winforms control.

On form load, form2 displays a chart bound to a datasource.

Close form2

The memory used is not released.

I used the .Net Memory Profiler from SciTech to confirm

(www.memprofiler.com)

See the attached jpg that shows the instances created but not removed.

Link to comment
Share on other sites

We cache some of these objects for performance reasons, e.g. we load our borders and palettes from resources, so once loaded we cache some of their attributes to avoid reprocessing the resources for subsequent charts.

The only element that catched my eye was the ChartFX.WinForms.Adornments.a object which had 2 instances. We will research on this.

In the meantime I would recommend you repeat the process a few more times, press the button to show the form and close it and compare the results, if all the numbers stay constant then you can see that your app will not leak.

Regards,

JuanC

Link to comment
Share on other sites

Thank you for the prompt reply - I have run the test iteratively and you are correct that the object count/resource usage does not increase. The results of the screenshot I sent are the same from displaying the form2 once or 10 times. I understand your point on caching for performance reasons, but it would be beneficial to have a manual method to force all resources to be unloaded (just my opinion).

 

 

 

Link to comment
Share on other sites

You may want to load the Chart FX Assembly in a separate application domain and release it when you are done with it. This way you not only will release all the resources but you will unload the assembly itself leaving ZERO footprint.

Normally, however, this is neither necessary nor recommended, the Chart FX footprint is fairly small.

Link to comment
Share on other sites

Thank you for the suggestion and while the footprint is small, our issue is that the application runs under Terminal Services with 40+ users, so there are times when we want to save as much as we can. Yours is minor compared to Crystal (which led to our profiling the app for memory usage in the first place). That sucker is a pig and has a leak that gradually brings the system to its knees.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...