Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 194544 - Unload profiling data doesn't seem to free up memory
Summary: Unload profiling data doesn't seem to free up memory
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 critical (vote)
Target Milestone: ---   Edit
Assignee: Marius Slavescu CLA
QA Contact:
URL:
Whiteboard: closed460
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-26 23:34 EDT by Valentina Popescu CLA
Modified: 2016-05-05 10:43 EDT (History)
1 user (show)

See Also:


Attachments
Heap analysis screen shot (78.31 KB, image/gif)
2007-06-30 10:27 EDT, Alex Nan CLA
no flags Details
Patch with the fix (2.53 KB, patch)
2007-07-04 12:39 EDT, Marius Slavescu CLA
no flags Details | Diff
Updated patch (7.11 KB, patch)
2007-07-04 16:57 EDT, Marius Slavescu CLA
slavescu: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Valentina Popescu CLA 2007-06-26 23:34:43 EDT
Using the candidate 4.4 driver try to run Unload profiling data on a process run using java 5 ( JVMTI profiling )

I should see the heap size going down but nothing seems to happen. This is a regression from previous releases, please investigate as a 4.4.0.1 candidate
Comment 1 Alex Nan CLA 2007-06-30 10:27:21 EDT
Created attachment 72818 [details]
Heap analysis screen shot

Attaching a screen shot from a heap dump after running an execution analysis profiling and then triggering Unload Profiling data. It's clear that the execution trace is not cleaned up.
Comment 2 Marius Slavescu CLA 2007-07-04 12:39:37 EDT
Created attachment 73043 [details]
Patch with the fix
Comment 3 Marius Slavescu CLA 2007-07-04 12:44:05 EDT
Eugene please review and test the attached patch.

Make sure you apply also the patches from bug 194543, 190685 and 148603.
Comment 4 Eugene Chan CLA 2007-07-04 15:49:22 EDT
The patch seems okay but context.cleanUp(); in HierarchyXMIResourceImpl have to check for null context.

Also the auto refresh UI thread (org.eclipse.hyades.trace.internal.ui.PDProjectExplorer$RefreshUI) is loading back the agent after each unload.

at org.eclipse.hyades.models.hierarchy.util.HierarchyXMIResourceImpl.doLoad(HierarchyXMIResourceImpl.java:294)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1354)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1155)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:256)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:271)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:398)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:217)
	at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:199)
	at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:259)
	at org.eclipse.hyades.models.hierarchy.impl.TRCAgentProxyImpl.getAgent(TRCAgentProxyImpl.java:710)
	at org.eclipse.hyades.trace.internal.ui.PDProjectExplorer$RefreshUI.isAgentModified(PDProjectExplorer.java:220)
	at org.eclipse.hyades.trace.internal.ui.PDProjectExplorer$RefreshUI.isModified(PDProjectExplorer.java:156)
	at org.eclipse.hyades.trace.internal.ui.PDProjectExplorer$RefreshUI.access$0(PDProjectExplorer.java:150)
	at org.eclipse.hyades.trace.internal.ui.PDProjectExplorer$1.run(PDProjectExplorer.java:132)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:615)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
Comment 5 Marius Slavescu CLA 2007-07-04 16:57:00 EDT
Created attachment 73071 [details]
Updated patch

Eugene please review and test this updated patch.
Comment 6 Eugene Chan CLA 2007-07-04 18:18:00 EDT
Hi Marius. The changes made in Refresh UI does not always work. If you look at org.eclipse.hyades.trace.ui.internal.piclient.XMLTraceDataProcessor.RefreshUI.run(),   line 824 actually set the collection to false when refresh. This is stopping the refresh from working in some use case.
And the unload action now frees up memory provide views are closed.
Comment 7 Marius Slavescu CLA 2007-07-04 19:46:41 EDT
(In reply to comment #6)
> Hi Marius. The changes made in Refresh UI does not always work. If you look at
> org.eclipse.hyades.trace.ui.internal.piclient.XMLTraceDataProcessor.RefreshUI.run(),
>   line 824 actually set the collection to false when refresh. This is stopping
> the refresh from working in some use case.
> And the unload action now frees up memory provide views are closed.
> 

The XMLTraceDataProcessor.RefreshUI thread will set it back on true on line 846 (getAgentProxy().setCollectionData(true)) when new data is received from the AC agent. As you noted in some cases the automatic refresh might not work, as I don't see a non risky quick fix to that problem the workaround would be to start  and stop the auto refresh or refresh manually.

The current implementation (before the patch) of org.eclipse.hyades.trace.internal.ui.PDProjectExplorer.RefreshUI.isAgentModified triggers the load of the currently selected agent irregardless of the fact that none of the profiling views are open, through the patch I avoid that problem too.

In 4.4.1 we should revisit the auto refresh and find a fix for the refresh problem. I'll open a separate bug for that problem to be handled post 4.4.0.1.



Comment 8 Marius Slavescu CLA 2007-07-04 19:52:40 EDT
I opened bug 195459 for the auto refresh UI side effect.
Comment 9 Marius Slavescu CLA 2007-07-04 21:35:23 EDT
Fix in CVS.
Comment 10 Marius Slavescu CLA 2007-07-04 21:36:10 EDT
Fixed
Comment 11 Paul Slauenwhite CLA 2009-06-30 13:47:52 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.
Comment 12 Paul Slauenwhite CLA 2009-06-30 13:59:10 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.