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

Bug 349358

Summary: The timerExec for the menuBar creates more GC'able objects
Product: [Eclipse Project] Platform Reporter: Paul Webster <pwebster>
Component: UIAssignee: Paul Webster <pwebster>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: dj.houghton, emoffatt, Mike_Wilson, remy.suen
Version: 4.1Flags: remy.suen: review+
Target Milestone: 4.1.1   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Reduce object creation during timer v01
none
Updating the action bars instead v01
none
Use RAT to track changes v01 none

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.