Community
Participate
Working Groups
Created attachment 248370 [details] A Test case to reproduce memory leak I get a memory leak with the attached sample. Steps to reproduce : 1. After import of the sample, I get 25M of heap size, as shown when enabling "Show heap status" preference 2. Open the session, I get 127M of heap size 3. Open and close many diagrams, I get 285M and many warning and one exception : !ENTRY org.eclipse.gmf.runtime.draw2d.ui 2 2 2014-11-04 15:46:01.119 !MESSAGE MapModeUtil#getMapMode(IFigure fig) fig parameter must be attached to a parent - using default MapMode Caused by: java.lang.NullPointerException at org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand$1.run(DeferredLayoutCommand.java:153) at org.eclipse.gmf.runtime.diagram.ui.util.EditPartUtil.synchronizeRunnableToMainThread(EditPartUtil.java:111) at org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand.doExecuteWithResult(DeferredLayoutCommand.java:186) at org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand.doExecute(AbstractTransactionalCommand.java:247) at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150) at org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy.execute(ICommandProxy.java:68) at org.eclipse.gef.commands.CompoundCommand.execute(CompoundCommand.java:111) at org.eclipse.sirius.diagram.ui.internal.refresh.layout.SiriusCanonicalLayoutCommand.executeLayoutDueToExternalChanges(SiriusCanonicalLayoutCommand.java:107) at org.eclipse.sirius.diagram.ui.internal.refresh.layout.SiriusCanonicalLayoutCommand.access$3(SiriusCanonicalLayoutCommand.java:104) at org.eclipse.sirius.diagram.ui.internal.refresh.layout.SiriusCanonicalLayoutCommand$1.run(SiriusCanonicalLayoutCommand.java:90) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) ... 23 more 4. I close the session and get ~300M of heap size, it seems that the NavigationHistory keeps references to editors and like DDiagramEditorImpl keeps a reference to the session, we have this leak.
In addition to potential memory leaks in Navigation History, we encounter issue at editor reopening when the representation or its semantic target is no more accessible, for example when they have been detached, the session is closed or they are in a closed CDO repo. I have asked a question to platform forum [1] to see if we can disable navigation history for our editors and if yes how to do it. [1] https://www.eclipse.org/forums/index.php/t/855704/