Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349358 - The timerExec for the menuBar creates more GC'able objects
Summary: The timerExec for the menuBar creates more GC'able objects
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.1.1   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-14 14:38 EDT by Paul Webster CLA
Modified: 2011-06-29 13:23 EDT (History)
4 users (show)

See Also:
remy.suen: review+


Attachments
Reduce object creation during timer v01 (7.10 KB, patch)
2011-06-14 20:17 EDT, Paul Webster CLA
no flags Details | Diff
Updating the action bars instead v01 (10.15 KB, patch)
2011-06-15 10:11 EDT, Paul Webster CLA
no flags Details | Diff
Use RAT to track changes v01 (9.54 KB, patch)
2011-06-16 07:08 EDT, Paul Webster CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2011-06-14 14:38:56 EDT
In bug 348798 we put in a fix for creating disposable objects.

The bug 348817 fix calls into code that evaluates second level MMenuItem model objects to ensure the top level menus are correctly visible.

Now more GC'able objects are being created.

PW
Comment 1 Paul Webster CLA 2011-06-14 20:17:37 EDT
Created attachment 197993 [details]
Reduce object creation during timer v01

This patch removes as much context creation as possible from the timerExec menu bar visibility call.

There's only one static context, and it is cleared and re-used every time.

It slows down the rate of heap growth, but it's still >1M/sec.

PW
Comment 2 Paul Webster CLA 2011-06-15 10:11:28 EDT
Created attachment 198025 [details]
Updating the action bars instead v01

This approach gets rid of the dependence on the timer, and tries to take advantage of the part activation change events to update the menus.

Much better on the GC side, but some changes to the system happen the updateActionBars(), so in the XSD editor case the Refactor menu doesn't show up unless you switch to the Package Explorer and back while the XSD is the active editor.

PW
Comment 3 Paul Webster CLA 2011-06-16 07:08:27 EDT
Created attachment 198081 [details]
Use RAT to track changes v01

This approach creates a RAT that accesses the variables that need tracking, so it will be re-run if they change.

It then posts an asyncExec(*) to actually evaluate the top level menu, and makes sure there is only one in the system at a time.

The system is responsive.  And when you're not doing something, the heap status shows a slow climb, <1M per 2 secs.

PW
Comment 4 Paul Webster CLA 2011-06-29 09:07:58 EDT
(In reply to comment #3)
> Created attachment 198081 [details]
> Use RAT to track changes v01


Remy, could you please review this change?

PW
Comment 5 Remy Suen CLA 2011-06-29 09:54:26 EDT
(In reply to comment #4)
> (In reply to comment #3)
> > Created attachment 198081 [details] [details]
> > Use RAT to track changes v01
> 
> 
> Remy, could you please review this change?

Makes sense to me.
Comment 6 Paul Webster CLA 2011-06-29 10:19:10 EDT
Released to HEAD
PW
Comment 7 Remy Suen CLA 2011-06-29 13:23:10 EDT
(In reply to comment #6)
> Released to HEAD

I don't think WorkbenchWindow.java was released. I've committed it to HEAD. Paul, please confirm.