Page 1 of 2

Memory leaks 2

Posted: Tue Mar 12, 2013 7:08 am
by 17463568
Hi,

relate my post here (http://www.teechart.net/support/viewtop ... 733#p60998), I investigate it further, and I see in memory some AWT-Objects, like SystemColor, Color, Font etc. It still reproducible in two different Java version (1,6 and 1,7). If you still have any question or any description above is not clear enough, don't hesitate to contact me.

Re: Memory leaks 2

Posted: Fri Mar 15, 2013 2:50 pm
by yeray
Hi mora,

Excuse us for the delay here.
We're investigating it.

Re: Memory leaks 2

Posted: Wed Apr 17, 2013 5:38 am
by 17463568
Hello Yeray

our software based on TeeChart is live since some weeks, but every some days it crashes because of the memory leaks.
We need urgently a solution for this and a complete new release of the Java edition of TeeChart.

Hubert

Re: Memory leaks 2

Posted: Wed May 08, 2013 10:32 am
by Marc
Hello Hubert,

Status update .. we are still investigating and will get back to this thread shortly.

Regards,
Marc Meumann

Re: Memory leaks 2

Posted: Tue May 14, 2013 2:34 pm
by Marc
Hello Hubert,

We've reviewed all elements that display as being in memory by VisualVM.

Remaining TeeChart items displayed in the VisualVM list in our tests are static variables, released with the application but not by a closed form. They are reusable, occupying about 12KB and will not use cumulative memory so should make no further impact on memory usage by your application or cause memory leakage effects.

It may be that you have found symptoms that do not concur with our results so please let us know if any particular TeeChart elements are of concern to you and we'll try and reproduce your findings.

Some unrelated changes and recent modifications sent to you are being prepared as part of a new release and will be published imminently.

Regards,
Marc

Re: Memory leaks 2

Posted: Fri Jun 21, 2013 6:38 am
by 17463568
Hello Marc
since weeks I try to track our problems running our visualization software during longer period. I can state that it crashes after some days.
My investigatuions are:
I'm sure that for 99% the reason is the TeeChart library
I had same problems under Windows + Sun Java and with Linux + OpenJDK 7, using different versions of SWT
I used JProfiler as well VisualVM.

The crash comes up when too much GDI objects (limit is 9999) are in use. So, in my opinion you are not disposing the GDI objects.
For each GDI object you need a mapping to a SWT object. If you dispose the SWT object, you need to first destroy the related GDI object. It seems that the old GDI objects remains in memory because the number of GDI objects is increasing permanently, which can be monitored by TaskManager as well GDIView.

Attached is a small test programm

Regards
Hubert

Re: Memory leaks 2

Posted: Fri Jun 21, 2013 6:43 am
by 17463568
Sorry, I forget the attachment

Re: Memory leaks 2

Posted: Tue Jun 25, 2013 5:22 pm
by Marc
Hello Hubert,

Thanks for the test project. We'll take a look to see whether we can find new clues with it.

Regards,
Marc

Re: Memory leaks 2

Posted: Fri Jul 05, 2013 9:13 am
by Marc
Hello Hubert,

We have emailed you a link to a TeeChart test version.

Regards,
Marc

Re: Memory leaks 2

Posted: Mon Jul 15, 2013 1:30 pm
by 17466531
Hello Marc,

We have the same memory leak problem that Hubert had.
Can we know when are you going to release the fixed version?

Thank you!

Best regards,
Ishan.

Re: Memory leaks 2

Posted: Tue Jul 16, 2013 1:58 pm
by yeray
Hi Ishan,

We're still finalising tests and awaiting feedback before publishing the next update release but we will send you a link to the test version so that you can run your own checks on it.

Re: Memory leaks 2

Posted: Thu Jul 18, 2013 10:24 am
by 17466531
Hi Yeray,

Seems test version has resolved the memory leak problem.
But it launches a swt exception when mouse click on a chart (for example when try to zoom).

Code: Select all

org.eclipse.swt.SWTException: Graphic is disposed
	at org.eclipse.swt.SWT.error(SWT.java:4361)
	at org.eclipse.swt.SWT.error(SWT.java:4276)
	at org.eclipse.swt.SWT.error(SWT.java:4247)
	at org.eclipse.swt.graphics.GC.setForeground(GC.java:4425)
	at com.steema.teechart.swt.Graphics3DSWT.prepareFont(Graphics3DSWT.java:789)
	at com.steema.teechart.swt.Graphics3DSWT.prepareFont(Graphics3DSWT.java:745)
	at com.steema.teechart.swt.Graphics3DSWT.measureString(Graphics3DSWT.java:805)
	at com.steema.teechart.drawing.Graphics3D.textHeight(Graphics3D.java:4010)
	at com.steema.teechart.drawing.Graphics3D.textHeight(Graphics3D.java:4036)
	at com.steema.teechart.drawing.Graphics3D.getFontHeight(Graphics3D.java:3027)
	at com.steema.teechart.legend.Legend.calcItemHeight(Legend.java:758)
	at com.steema.teechart.legend.Legend.clicked(Legend.java:708)
	at com.steema.teechart.legend.Legend.clicked(Legend.java:691)
	at com.steema.teechart.Chart.calcNeedClickedPart(Chart.java:1095)
	at com.steema.teechart.Chart.mousePressed(Chart.java:1180)
	at com.steema.teechart.TChart.processMouseEvent(TChart.java:1259)
	at com.steema.teechart.TChart$4.handleEvent(TChart.java:363)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:150)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Regards,
Ishan.

Re: Memory leaks 2

Posted: Thu Jul 18, 2013 11:39 am
by yeray
Hello,

You are right. We've reproduced it and we are looking at it.
We'll send you a new test version as soon as we solve it.

Re: Memory leaks 2

Posted: Fri Jul 19, 2013 10:31 am
by yeray
Hi,

We solved it. I'll send you the new testing version.

Re: Memory leaks 2

Posted: Fri Jul 19, 2013 1:11 pm
by 17466531
Hi Yeray,

Ok, click on chart now doesn't launch any exceptions.
But there is still a memory leak with fonts... for example try to move mouse over a chart, it increases gdi.

Here I attach a screenshoot of gdiview of my application (pid 4008) after a some time.
Screen shot 2013-07-19 at 2.51.29 PM.png
Screen shot 2013-07-19 at 2.51.29 PM.png (96.34 KiB) Viewed 8504 times
Ishan.