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.
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.
Created attachment 112058 [details] profiler snapshot
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.
I found a method on StreamSource we can use right at the moment. No need to change the diff API.
fix: http://hg.netbeans.org/core-main/rev/4de9e1479fe7
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