Memory leaks 2

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
mora
Newbie
Newbie
Posts: 19
Joined: Thu Sep 27, 2012 12:00 am
Contact:

Memory leaks 2

Post by mora » Tue Mar 12, 2013 7:08 am

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.

Yeray
Site Admin
Site Admin
Posts: 8747
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Memory leaks 2

Post by Yeray » Fri Mar 15, 2013 2:50 pm

Hi mora,

Excuse us for the delay here.
We're investigating it.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

mora
Newbie
Newbie
Posts: 19
Joined: Thu Sep 27, 2012 12:00 am
Contact:

Re: Memory leaks 2

Post by mora » Wed Apr 17, 2013 5:38 am

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

Marc
Site Admin
Site Admin
Posts: 933
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Memory leaks 2

Post by Marc » Wed May 08, 2013 10:32 am

Hello Hubert,

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

Regards,
Marc Meumann
Steema Support

Marc
Site Admin
Site Admin
Posts: 933
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Memory leaks 2

Post by Marc » Tue May 14, 2013 2:34 pm

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
Steema Support

mora
Newbie
Newbie
Posts: 19
Joined: Thu Sep 27, 2012 12:00 am
Contact:

Re: Memory leaks 2

Post by mora » Fri Jun 21, 2013 6:38 am

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

mora
Newbie
Newbie
Posts: 19
Joined: Thu Sep 27, 2012 12:00 am
Contact:

Re: Memory leaks 2

Post by mora » Fri Jun 21, 2013 6:43 am

Sorry, I forget the attachment
Attachments
MainTest.zip
(936 Bytes) Downloaded 318 times

Marc
Site Admin
Site Admin
Posts: 933
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Memory leaks 2

Post by Marc » Tue Jun 25, 2013 5:22 pm

Hello Hubert,

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

Regards,
Marc

Marc
Site Admin
Site Admin
Posts: 933
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Memory leaks 2

Post by Marc » Fri Jul 05, 2013 9:13 am

Hello Hubert,

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

Regards,
Marc
Steema Support

Myti
Newbie
Newbie
Posts: 10
Joined: Mon Jul 08, 2013 12:00 am

Re: Memory leaks 2

Post by Myti » Mon Jul 15, 2013 1:30 pm

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.

Yeray
Site Admin
Site Admin
Posts: 8747
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Memory leaks 2

Post by Yeray » Tue Jul 16, 2013 1:58 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Myti
Newbie
Newbie
Posts: 10
Joined: Mon Jul 08, 2013 12:00 am

Re: Memory leaks 2

Post by Myti » Thu Jul 18, 2013 10:24 am

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.

Yeray
Site Admin
Site Admin
Posts: 8747
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Memory leaks 2

Post by Yeray » Thu Jul 18, 2013 11:39 am

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yeray
Site Admin
Site Admin
Posts: 8747
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Memory leaks 2

Post by Yeray » Fri Jul 19, 2013 10:31 am

Hi,

We solved it. I'll send you the new testing version.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Myti
Newbie
Newbie
Posts: 10
Joined: Mon Jul 08, 2013 12:00 am

Re: Memory leaks 2

Post by Myti » Fri Jul 19, 2013 1:11 pm

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 8451 times
Ishan.

Post Reply