Bug 389257 - Objects leaked when opening and closing an editor
Summary: Objects leaked when opening and closing an editor
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 4.2.2   Edit
Assignee: Oleg Besedin CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks: 385272
  Show dependency tree
 
Reported: 2012-09-11 09:27 EDT by Dani Megert CLA
Modified: 2013-01-15 09:16 EST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2012-09-11 09:27:33 EDT
M20120909-2000.

Objects are leaked in a simple close/open text editor scenario.

Simple test case:
0. start new workspace
1. prepare a perspective with only the Navigator view open with a text file
   in it
2. reset the instance counter of your profiler
3. open the editor
4. close the editor
==> several instances are leaked, e.g. XMLMemento, EclipseContext, NavigationHistoryEntry, ValueComputation, etc.
Comment 1 Dani Megert CLA 2012-09-12 03:13:06 EDT
(In reply to comment #0)
> ==> several instances are leaked, e.g. XMLMemento, EclipseContext,
> NavigationHistoryEntry, ValueComputation, etc.

At least NavigationHistoryEntry is probably not a leak because it is OK to be kept in the navigation history.
Comment 2 Oleg Besedin CLA 2012-10-03 10:17:36 EDT
(In reply to comment #1)
> At least NavigationHistoryEntry is probably not a leak because it is OK to
> be kept in the navigation history.

Correct, the XMLMemento, NavigationHistoryEntry, TextSelectionNavigationLocation, and related XML elements are not leaks. 

The are used by the navigation history which by a set depth of 50 (NavigationHistory#CAPACITY). Once you reach the capacity it releases the older entries.

(Can be verified by changing capacity to, say, 3. Those elements no longer appear in memory snapshot deltas after 3 open/close cycles.)
Comment 3 Dani Megert CLA 2012-10-05 06:15:18 EDT
*** Bug 391138 has been marked as a duplicate of this bug. ***
Comment 4 Dani Megert CLA 2012-10-05 06:16:03 EDT
(In reply to comment #3)
> *** Bug 391138 has been marked as a duplicate of this bug. ***

This bug contains a possible patch for a leak.
Comment 5 Paul Webster CLA 2012-10-10 10:00:34 EDT
You mean attachment 221913 [details] ?

Eric recently changed the handling of the intermediate composite when he moved the grab handles into CSS.

PW
Comment 6 Dani Megert CLA 2012-10-10 10:18:57 EDT
(In reply to comment #5)
> You mean attachment 221913 [details] [diff] ?
> 
> Eric recently changed the handling of the intermediate composite when he
> moved the grab handles into CSS.
> 
> PW

Look at the history of bug 391138 and you know it ;-).
Comment 7 Oleg Besedin CLA 2012-10-18 14:41:46 EDT
I released the ToolBarManagerRenderer patch - thanks Snjezana!

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_2_maintenance&id=e9b68830bd95c74a0821e544efca4d943ec6b79e
Comment 8 Oleg Besedin CLA 2012-10-18 14:44:06 EDT
The common part closing/opening issues have being resolved in bug 389250 . Several specific editor issues were resolved under this bug, in the bug 391138, and in the bug 391253.
Comment 9 Oleg Besedin CLA 2012-10-30 13:57:33 EDT
Verified using I20121030-0800 and M20121024-1600.
Comment 10 Dani Megert CLA 2013-01-15 09:16:45 EST
(In reply to comment #8)
> The common part closing/opening issues have being resolved in bug 389250 .
> Several specific editor issues were resolved under this bug, in the bug
> 391138, and in the bug 391253.

Verified this in N20130114-2000: much better now!