Bug 229925 - Memory optimization of org.eclipse.gmf.runtime.diagram.ui.editpolicies.PopupBarEditPolicy#imagesToBeDisposed
Summary: Memory optimization of org.eclipse.gmf.runtime.diagram.ui.editpolicies.PopupB...
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 2.0.1   Edit
Hardware: PC All
: P3 normal
Target Milestone: 2.1   Edit
Assignee: Lidija Grahek CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-05-02 05:19 EDT by Mariot Chauvin CLA
Modified: 2010-07-19 12:28 EDT (History)
1 user (show)

See Also:
ahunter.eclipse: review+


Attachments
contains described optimization (1.75 KB, patch)
2008-06-02 15:23 EDT, Lidija Grahek CLA
ahunter.eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mariot Chauvin CLA 2008-05-02 05:19:47 EDT
By running the SAP memory analyser tool (http://www.eclipse.org/mat/), I remarked that most instances of org.eclipse.gmf.runtime.diagram.ui.editpolicies.PopupBarEditPolicy have an empty imageimagesToBeDisposed array list.

Below is the current initialization :

/** Images created that must be deleted when popup bar is removed */
protected List imagesToBeDisposed = new ArrayList();

To avoid memory wasted it would be nice to have a lazy initialization :

...
myDisabledImage = new Image(Display.getCurrent(), theImage, SWT.IMAGE_DISABLE);
if (imageToBeDisposed == null)
   imageToBeDisposed = new ArrayList(); 
imagesToBeDisposed.add(myDisabledImage);
...
Comment 1 Lidija Grahek CLA 2008-06-02 15:23:10 EDT
Created attachment 103183 [details]
contains described optimization
Comment 2 Anthony Hunter CLA 2008-06-02 15:47:38 EDT
Committed to HEAD
Comment 3 Richard Gronback CLA 2008-08-13 13:10:00 EDT
[target cleanup] 2.1 RC was the original target milestone for this bug
Comment 4 Eclipse Webmaster CLA 2010-07-19 12:28:11 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime Diagram was the original product and component for this bug