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

Bug 481147

Summary: [Scripting] Memory leak in client scripting
Product: [RT] RAP Reporter: Tim Buschtoens <tbuschto>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mknauer, tbuschto
Version: 3.0   
Target Milestone: 3.1 M3   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/#/c/59386/
Whiteboard: SR302

Description Tim Buschtoens CLA 2015-10-30 16:27:05 EDT
When creating a widget proxy (e.g. by registering a ClientListener on the widget), it is stored in global list inside WidgetProxyFactory. When the original widget is disposed, so should the proxy, but this is not always the case. This is because the "destroy" event is used instead of the "dispose" event.

Also, there is a smaller memory leak in EventBinding.js which unnecessarily keeps empty arrays in the wrapperRegistry object.

All of this is unrelated to Bug 413994.
Comment 1 Tim Buschtoens CLA 2015-11-02 05:07:22 EST
Fixed by switching to the "dispose" event in commit 51b55395aa62b951d2375641d7f57cdad203ea04
Comment 2 Tim Buschtoens CLA 2015-11-05 05:22:25 EST
There is probably still a leak: The dispose event does not remove the listener wrapper in EventBinding.js. That wrapper uses a closure, so there is a risk that more than just the wrapper itself leaking.
Comment 3 Tim Buschtoens CLA 2015-11-06 05:18:23 EST
The second leak was closed for good with commit c1abd23021bc34c16d53e1fd717a8aaea9621654. The wrapper function are now stored in the widget, so they will be collected once the widget is properly disposed.
Comment 4 Ivan Furnadjiev CLA 2016-02-01 05:45:13 EST
Backported to 3.0-maintenance branch with change https://git.eclipse.org/r/#/c/64961/ and https://git.eclipse.org/r/#/c/64962/