Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359045

Summary: WirePuller memory leak
Product: [RT] Riena Reporter: Jürgen Becker <juergen.becker>
Component: CoreAssignee: Stefan Liebig <Stefan.Liebig>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 4.0.0   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Jürgen Becker CLA 2011-09-27 07:55:19 EDT
Every WirePuller instance holds a reference to a bean (e.g. Sub/ModuleController) and every WirePuller registers a BundleStoppingListener with the platform, to be informed if the bundle containing the bean class is stopped.
When the bean is e.g. disposed/stopped the WirePuller does not know about it and a reference to the bean is kept, even if it is no longer used. This causes memory leaks.

The BundleStoppingListener, and thus the WirePuller, must be deregistered if the bean is no longer in use, to free the resources.
Comment 1 Stefan Liebig CLA 2011-09-27 08:07:56 EDT
Yep, releasing the wire puller when a bundle stops is ok but most of the time too late.
Comment 2 Stefan Liebig CLA 2012-01-04 02:43:56 EST
Has been fixed 3 months ago by keeping a weak reference (WeakRef) for the wired bean. When the bean gets garbage collected the wire puller will be stopped.