Bug 2907

Summary: Severe: memory leak in sync view (1GKKUA5)
Product: [Eclipse Project] Platform Reporter: John Arthorne <john.arthorne>
Component: CompareAssignee: Andre Weinand <andre_weinand>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: ---   
Hardware: All   
OS: Windows NT   
Whiteboard:
Bug Depends on:    
Bug Blocks: 266    

Description John Arthorne CLA 2001-10-10 22:45:54 EDT
1) Open Eclipse in a profiler such as optimizeIt
2) Select Team->Synchronize on a project
3) When the resulting sync view opens, close it.
4) In OptimizeIt, force a garbage collection.
5) Notice that all the objects allocated for the sync view are still around.

There is a memory leak in the compare FW that holds onto the DiffTreeViewer
instance, which means all the model objects inside it are held onto.  I suspect
the method DiffTreeViewer#handleDispose:

	protected void handleDispose(DisposeEvent event) {
		if (fPreferenceChangeListener != null) {
			IPreferenceStore ps= CompareUIPlugin.getDefault().getPreferenceStore();
			if (ps != null)
				ps.addPropertyChangeListener(fPreferenceChangeListener);
			fPreferenceChangeListener= null;
		}
		... etc ...
	}

Notice that in handleDispose, it ADDS a property change listener, rather than removing.
I'm not 100% certain if this is the source of the memory leak, but it seems likely.

This is a fairly major bug, because it means users who frequently close the sync view
without syncing end up with large amounts of garbage being held onto.

NOTES:

AW (27.09.2001 10:02:55)
	fixed in > 0.0201
Comment 1 James Moody CLA 2001-10-11 13:48:31 EDT
This does not appear to have been fixed in 0.203.
Comment 2 DJ Houghton CLA 2001-10-29 19:24:39 EST
PRODUCT VERSION:

Build 0.131

Comment 3 Andre Weinand CLA 2001-11-14 04:04:37 EST
Verified that suggested patch is in build 011113