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.
This issue was reported manually by thurka. It already has 1 duplicates Build: NetBeans IDE 8.0 (Build 201403101706) VM: Java HotSpot(TM) Client VM, 25.0-b70, Java(TM) SE Runtime Environment, 1.8.0-b132 OS: Windows 7 User Comments: GUEST: I opened up the IDE Stacktrace: java.lang.OutOfMemoryError: Java heap space at java.io.ObjectOutputStream$HandleTable.growEntries(ObjectOutputStream.java:2347) at java.io.ObjectOutputStream$HandleTable.assign(ObjectOutputStream.java:2276) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1428) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
Created attachment 148323 [details] stacktrace
Created attachment 148324 [details] nps file extracted from the heap dump
AWT is blocked by org.netbeans.modules.csl.navigation.ClassMemberPanelUI thread. The most of the time in ClassMemberPanelUI thread is spent in Children$Dupl.getKey() and Children$Dupl.getCnt(), because there is a huge (
Created attachment 148354 [details] Proposed patch to fix this issue
Comment #3 was truncated. Below is the full description of the problem: AWT is blocked by org.netbeans.modules.csl.navigation.ClassMemberPanelUI thread. The most of the time in ClassMemberPanelUI thread is spent in Children$Dupl.getKey() and Children$Dupl.getCnt(), because there is a huge (>1500) number of nodes' keys, which are equal. Nodes have infrastructure to distinguish those duplicated keys - the key either real value or Dupl (Dupl (Dupl (... key ...))). This is very inefficient if there a huge number of duplicated keys and can be improved, but the real problem here are those duplicated keys. I have find out that they come from parsing css file and the keys are instances CssRuleStructureItem and used in navigator view. CssRuleStructureItem have hashcode() and equals() implemented based only on the name of the CssRuleStructureItem - unfortunately in this particular css file, there are thousands of CssRuleStructureItem with the same name. The fix seems to me simple - change hashcode() and equals() to also count with position of the element. This will solve the problem with duplicated keys in navigator view. See attached patch for the proposed fix.
Thanks Tome for your evaluation and the patch. I'll take a look at it.
The patch definitively fixed the problem of files with many duplicated selectors. It also seems there's no impact on the css navigator behaviour. I gave it a slight testing and all seems ok. Still it would be nice if Vlada played with the navigator for a while, preferable on a big file. Thank you Tome for the patch and Vlado for the test. changeset: 276211:08542b2e593c summary: #246009 - AWT blocked by org.netbeans.modules.csl.navigation.ClassMemberPanelUI thread
Of course, I'll test it tomorrow
Integrated into 'main-silver', will be available in build *201407300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/08542b2e593c User: Marek Fukala <mfukala@netbeans.org> Log: #246009 - AWT blocked by org.netbeans.modules.csl.navigation.ClassMemberPanelUI thread
*** Bug 246123 has been marked as a duplicate of this bug. ***
*** Bug 246144 has been marked as a duplicate of this bug. ***
I've tried to edit/close/open/save/navigate/re-order navigator with CSS file of ~17k lines (several copy&paste of twitter bootstrap), all seems OK. Product Version: NetBeans IDE Dev (Build 201407310738) Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13 System: Linux version 3.13.0-32-generic running on i386; UTF-8; en_US (nb)
Thanks a lot