Bug 25854 - [Text Editor] editor not unregistering from key binding service
Summary: [Text Editor] editor not unregistering from key binding service
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0.2   Edit
Hardware: PC All
: P2 major (vote)
Target Milestone: 2.1 M4   Edit
Assignee: Chris McLaren CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2002-11-07 15:33 EST by Tetsuro Asahata CLA
Modified: 2003-01-08 16:41 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tetsuro Asahata CLA 2002-11-07 15:33:24 EST
AcceleratorScope class holds KeyBindingService instance as a currentService 
static variable evenif the service is disposed.
And the service holds all registered actions even after it has been disposed.

This causes severe memory leak, since one of our own action holds
our editor instance, and it remains in memory until the currentService is 
replaced to another KeyBindingService instance.
Comment 1 Tetsuro Asahata CLA 2002-11-07 15:36:34 EST
This problem could happen any editor which extends AbstructTextEditor class,
and may leak large memory if the action holds large objects.
Comment 2 Dani Megert CLA 2002-11-08 05:04:40 EST
Tetsuro,

key binding support is changing in 2.1 and AcceleratorScope class is gone.

Regarding 2.0.2: memory leak fixes have been included in yesterdays 2.0.2 build
(M20021107). Could you please verify that your problem is fixed with yesterdays
build. Text editor and Java editor (both subclasses of AbstractTextEditor) are
now removed from memory after being closed and I verified today that all
instances of KeybindingService go away.

Please reopen if not fixed and if fix is critical for 2.0.2.
Comment 3 Tetsuro Asahata CLA 2002-11-08 11:49:42 EST
KeyBinding service still remains in memory with 1107 2.0.2 build.
I think this is a different problem.

To reproduce, 
1. Open TextEditor
2. Type in a character from keyboard
3. Close editor

Then, TextEditor remains in memory since KeyBindingService eventually holds 
FindReplaceAction, and the action eventually holds the editor.

The editor instance will remain in memory until other AbstructTextEditor based 
class is opened and user type in a character.

Comment 4 Dani Megert CLA 2002-11-08 12:19:12 EST
I agree. I didn't type a character. It's leaking at most one editor.

If this is a must fix for 2.0.2 then please talk to Kevin Haaland. Otherwise we
will address this in the 2.1 stream.
Comment 5 Tetsuro Asahata CLA 2002-11-08 13:07:30 EST
I agree that this is not severe enough to get into 2.0.2.

Comment 6 Dani Megert CLA 2002-11-11 07:06:45 EST
Accelarators are provided by platform UI.
Comment 7 Chris McLaren CLA 2002-12-02 14:46:24 EST
IKeyBindingService now has unregisterAction(IAction) method to remove 
references. Moving to [Text] for comment.
Comment 8 Kai-Uwe Maetzel CLA 2002-12-10 13:27:10 EST
Is it the editor's responsibility to unregister the actions? As one key binding 
service is created per editor, the key binding service itself could perform the 
clean up. Moving to Platform UI for comment.
Comment 9 Chris McLaren CLA 2003-01-08 16:41:14 EST
fixed 2.1 M4 (i think..)
this shouldn't be a problem anymore. the KeyBindingService reference for an 
editor is in the editor's PartSite, which should disappear when the editor is 
closed.