Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 379788 - Memory leak in DefaultMarkerBehavior
Summary: Memory leak in DefaultMarkerBehavior
Status: CLOSED FIXED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.9.0   Edit
Hardware: All All
: P3 critical (vote)
Target Milestone: 0.9.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: Juno RC1 Theme_bugs
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-17 04:06 EDT by Felix Velasco CLA
Modified: 2012-06-29 04:28 EDT (History)
2 users (show)

See Also:
michael.wenz: juno+


Attachments
Proposed patch (886 bytes, patch)
2012-05-17 04:11 EDT, Felix Velasco CLA
michael.wenz: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Velasco CLA 2012-05-17 04:06:29 EDT
Build Identifier: 

DefaultMarkerBehavior adds an adapter (problemIndicationAdapter) to the ResourceSet of the running editingDomain, but doesn't removes it on disposal.

If the editing domain is shared, after the closing of the graphiti editor, this adapter lingers on, and keeps alive the DiagramEditor as long as the editing domain is alive.

It also prevents the EmfService#diagToProvider WeakHashMap from freeing the diagrams, thus keeping the whole graphiti model in memory, even if it belonged in an unloaded resource.

Reproducible: Always
Comment 1 Felix Velasco CLA 2012-05-17 04:11:03 EDT
Created attachment 215753 [details]
Proposed patch

Remove adapter on disposal
Comment 2 Michael Wenz CLA 2012-05-21 09:10:52 EDT
Thanks for pointing this out and providing the fix!

I added the cleanup of the members of DefaultMarkerBehavior and therefore had to change the sequence of the dispose calls in DiagramEditor.

Checked-in and pushed to Eclipse:
commit e6921295af5801867f73434731c9d5ec7ff973d8
Author: mwenz <michael.wenz@sap.com> 2012-05-21 15:08:03
Committer: mwenz <michael.wenz@sap.com> 2012-05-21 15:08:03
Parent: 3041651840445ba36eb1de8f81fb5f2f261b72ce (Revert "Updated to RC1 version of Orbit")
Branches: origin/master, master
Comment 3 Michael Wenz CLA 2012-05-22 02:21:54 EDT
Bookkeeping
Comment 4 Michael Wenz CLA 2012-06-29 04:28:43 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)