Bug 2907 - Severe: memory leak in sync view (1GKKUA5)
Summary: Severe: memory leak in sync view (1GKKUA5)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 2.0   Edit
Hardware: All Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Andre Weinand CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 266
  Show dependency tree
 
Reported: 2001-10-10 22:45 EDT by John Arthorne CLA
Modified: 2001-11-14 04:04 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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