This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 97201 - GuardedBlocksHighlighting seems to cause major editor leakage
Summary: GuardedBlocksHighlighting seems to cause major editor leakage
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Vitezslav Stejskal
Depends on:
Blocks: 98171
  Show dependency tree
Reported: 2007-03-05 15:10 UTC by Petr Nejedly
Modified: 2007-11-05 13:45 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Petr Nejedly 2007-03-05 15:10:13 UTC
After few days of working, I've got too many editors left in memory (according
to Timers/Counters). Heap dump and analysis in NetBeans Profiler revealed that
they are generally held in memory through GuardedBlocksHighlighting listening on
a shared instance of ProxyLookup$R (from MimeLookup).
I'll keep the heap dump for a while if you need some clarification, but it is
over 100MB.
Comment 1 Petr Nejedly 2007-03-05 15:19:21 UTC
Note: my build was almost a month old. I'll try to reproduce this with new build.
Comment 2 Vitezslav Stejskal 2007-03-05 15:57:35 UTC
Ok, I'll have a look. I don't think anything has changed in GBH in the last
month :-(. Could you please attach one example of the object graph showing the
memory leak? Thanks.
Comment 3 Petr Nejedly 2007-03-05 16:25:23 UTC
Insane integrated into Timers/Counters window told me this:
Comment 4 Petr Nejedly 2007-03-05 16:49:42 UTC
Note that "lastEditor" is a kind of leak alone, but I'm not talking about the
editor held this way. The last editor (or any currently opened editor - I've got
none at the time of the heap dump) references all the visited editors through
the listener on the (shared and kept in memory as long as last editor)

I have just reproduced the same issue (the same reference chain) in current build.
Try the runtime watches window, right click on the entry for any already closed
editor -> find refs and give it some time (and leave enough heap).
Comment 5 Petr Nejedly 2007-03-19 14:47:16 UTC
looks simple to me..
Comment 6 Jan Lahoda 2007-03-20 19:23:39 UTC
Vito, could you please take a look on this as soon as possible? Thanks.
Comment 7 Vitezslav Stejskal 2007-03-21 04:18:11 UTC
Should be fixed now. Could you please check that the leak's gone?

Just for the record: highlighting layers generally do not need to listen on
FontColorSettings changes, this is done by the infrastructure and if FCS changes
the layers will be recreated.

Checking in;
new revision: 1.2; previous revision: 1.1
Checking in;
new revision: 1.2; previous revision: 1.1
Comment 8 Petr Nejedly 2007-03-26 13:06:22 UTC
Looks OK now, other leaks are probably still there.