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 203724 - slowness and memory leak in Git diff viewer
Summary: slowness and memory leak in Git diff viewer
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 7.1
Hardware: All All
: P2 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-14 12:55 UTC by Stepan Zebra
Modified: 2011-10-24 14:02 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
netbeans.exe in Task Manager & IDE Memory Usage (16.48 KB, image/png)
2011-10-14 12:55 UTC, Stepan Zebra
Details
profiler snapshot (68.45 KB, application/octet-stream)
2011-10-14 12:57 UTC, Stepan Zebra
Details
patch proposal (7.84 KB, patch)
2011-10-18 16:07 UTC, Ondrej Vrabec
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stepan Zebra 2011-10-14 12:55:36 UTC
Created attachment 112057 [details]
netbeans.exe in Task Manager & IDE Memory Usage

Product Version: NetBeans IDE Dev (Build 201110120600)
Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b17
System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb)

Open Diff on a Git versioned project with at least two modified files, one staged and one not. In the Diff window, keep switching between the HEAD/Index/WorkingTree views in fast intervals. After a while, the IDE gets slower and slower and became almost unresponsive, showing a high memory consumption.
Comment 1 Stepan Zebra 2011-10-14 12:57:04 UTC
Created attachment 112058 [details]
profiler snapshot
Comment 2 Ondrej Vrabec 2011-10-18 16:07:03 UTC
Created attachment 112188 [details]
patch proposal

Problem is that diff opens document that are never closed, they float in memory, have references to the whole diff component tree and seem not to be ever GCed.
The patch may help at some point, it closes the documents via EditableCookie.Observable when the diff view component is closed (at least it tries to guess the fact).
However it's a major modification in diff behavior and could cause regression in all modules using diff API. Needs to be reviewed in detail, tested thoroughly and all of that best at the start of a release cycle.
Better solution would be to close opened documents on demand from the caller, but for that the API would need to be enhanced.
Comment 3 Ondrej Vrabec 2011-10-20 10:44:50 UTC
I found a method on StreamSource we can use right at the moment. No need to change the diff API.
Comment 4 Ondrej Vrabec 2011-10-20 10:46:19 UTC
fix: http://hg.netbeans.org/core-main/rev/4de9e1479fe7
Comment 5 Quality Engineering 2011-10-24 14:02:21 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/4de9e1479fe7
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #203724 - slowness and memory leak in Git diff viewer