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

Bug 323489

Summary: [KeyBindings] Reduce memory footprint of BindingManager
Product: [Eclipse Project] Platform Reporter: Paul Webster <pwebster>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bokowski, chris, daniel_megert, mukund, prakash, raji, remy.suen
Version: 3.4.2   
Target Milestone: 3.7 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 284269    
Bug Blocks:    

Description Paul Webster CLA 2010-08-24 09:56:27 EDT
+++ This bug was initially created as a clone of Bug #284269 +++

Build ID: 3.4.2.M20090107-0800

Steps To Reproduce:
Currently BindingManager is retaining 1.1MB of Java heap - I dug into why and one of the things I ran across was that we keep in memory KeyBindings for all platforms. I see there is code to modify the platform at runtime, and I assume this will rebind keys to the new platform, but in the case where the platform never changes at runtime isn't this a waste?

Out of the box I see a total of 630 bindings:
carbon: 119
gtk: 72
motif:14
win32: 58
null: 367

I modified BindingManager.setBindings() to filter out all non-null bindings that weren't for the current platform, which should never change on our RCP application.

I reran the change through our DayInTheLife automation and I see a significant improvement, from 1,114,195 bytes to 298,197 bytes.

I don't imagine this is a change that Eclipse could or would want, but for RCP apps that aren't going to change their platform at runtime does this seem reasonable?

More information:
Comment 1 Paul Webster CLA 2010-11-09 10:56:33 EST
attachment #177310 [details]

Released to HEAD
PW
Comment 2 Paul Webster CLA 2010-12-07 14:10:42 EST
In I20101206-1800
PW