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 133360 [details] Stackdump of OOME When using a OutlineView and adding a huge amount (10000+) of Nodes to it using one Children instance this OOME happens. For test and analysis purposes we've tried to create a simplistic use case. See the attached java class and run it using a limited heap (192mb using 64bit jdk7). The problem we found is the memory inefficient way to determine and return the contiguous index blocks. The ArrayLists and Integer Objects used in the determination introduce an exorbitant memory and GC overhead. The heapdump i will attach soon shows that the method getContiguousIndexBlocks had allocated approximately 170MB of data to get the contiguous index blocks of an int[] with a length of 10000. OOME was thrown while creating a new ArrayList. The attached patch solves that problem while working with only the resulting list of contiguous index blocks.
Created attachment 133361 [details] Test application please run with -Xmx192m on 64bit jdk7
Created attachment 133362 [details] Heapdump of testapplication created by -XX:+HeapDumpOnOutOfMemoryError
Created attachment 133363 [details] proposed patch
Thank you for the patch and description. It's applied by changeset: 255366:de7ea296d898, slightly modified. http://hg.netbeans.org/core-main/rev/de7ea296d898 I've also wrote a siple test http://hg.netbeans.org/core-main/rev/35e2df2b981b
Integrated into 'main-golden', will be available in build *201306022301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/de7ea296d898 User: mentlicher@netbeans.org Log: #228366: Memory requirements of getContiguousIndexBlocks() are improved by a patch provided by mklaehn.