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 98969 - (Java)DataObject + editor leak
Summary: (Java)DataObject + editor leak
Status: VERIFIED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@versioncontrol
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 98171
  Show dependency tree
 
Reported: 2007-03-26 13:56 UTC by Petr Nejedly
Modified: 2007-03-27 13:25 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Nejedly 2007-03-26 13:56:00 UTC
It seems that there is major leak in versioning, see the following reference path:
org.netbeans.modules.java.JavaDataObject@14c5754[MasterFileObject@c92575[space/nenik/work/nb/performance/insanelib/src/org/netbeans/insane/impl/SmallObjectMap.java]]:
private static org.netbeans.modules.versioning.spi.VCSContext
org.netbeans.modules.versioning.spi.VCSContext.contextCached->
org.netbeans.modules.versioning.spi.VCSContext@133d7e5-nodes->
[Lorg.openide.nodes.Node;@32aa93-[4]->
org.openide.nodes.FilterNode@20b6e7-original->
org.netbeans.modules.java.JavaNode@5f10ca-obj->
org.netbeans.modules.java.JavaDataObject@14c5754

I opened a package worth of java files, collapsed the explorer, restarted the
IDE (to prevent interference with other potential leak through nodes+navigator)
and closed all the editors (one after one to prevent another leak in uilogger).
I then tried to gc() everything, but the editors got stuck in memory, which I
revealed using Window->Runtime watches (the list) and the "find refs" action,
which produced the above listed output.
Comment 1 Petr Nejedly 2007-03-26 13:59:21 UTC
Note: You have to close the files one-by-one after restart also because of lazy
loading. They are not actually loaded before you switch to them for the first
time in the session.
Comment 2 Maros Sandor 2007-03-26 14:14:13 UTC
I think I can reference contextCached weakly. But this should not cause any
serious leak because there is only one cached VCSContext at any one time.
Comment 3 Maros Sandor 2007-03-26 16:32:30 UTC
VCSContext is now cached via WeakReference.

/shared/data/ccvs/repository/versioncontrol/src/org/netbeans/modules/versioning/spi/VCSContext.java,v
 <--  VCSContext.java
new revision: 1.5; previous revision: 1.4
Comment 4 Petr Nejedly 2007-03-27 12:50:43 UTC
The fix in trunk really helps.
Comment 5 Peter Pis 2007-03-27 13:25:33 UTC
Verified in 
NetBeans IDE Dev (Build 20070327-0828)
1.5.0_11; Java HotSpot(TM) Client VM 1.5.0_11-b03
Windows XP version 5.1 running on x86
en_GB (nb); Cp1252
Comment 6 Maros Sandor 2007-03-27 13:25:52 UTC
Merged into 6.0M8.

/shared/data/ccvs/repository/versioncontrol/src/org/netbeans/modules/versioning/spi/VCSContext.java,v
 <--  VCSContext.java
new revision: 1.4.4.1; previous revision: 1.4