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 246009 - AWT blocked by org.netbeans.modules.csl.navigation.ClassMemberPanelUI thread
Summary: AWT blocked by org.netbeans.modules.csl.navigation.ClassMemberPanelUI thread
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: CSS Editor (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Marek Fukala
URL:
Keywords:
: 246123 246144 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-07-25 14:13 UTC by Exceptions Reporter
Modified: 2014-07-31 18:12 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 210910


Attachments
stacktrace (2.54 KB, text/plain)
2014-07-25 14:13 UTC, Exceptions Reporter
Details
nps file extracted from the heap dump (61.59 KB, application/octet-stream)
2014-07-25 14:15 UTC, Tomas Hurka
Details
Proposed patch to fix this issue (848 bytes, patch)
2014-07-28 10:24 UTC, Tomas Hurka
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2014-07-25 14:13:57 UTC
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)
Comment 1 Exceptions Reporter 2014-07-25 14:13:59 UTC
Created attachment 148323 [details]
stacktrace
Comment 2 Tomas Hurka 2014-07-25 14:15:58 UTC
Created attachment 148324 [details]
nps file extracted from the heap dump
Comment 3 Tomas Hurka 2014-07-28 10:22:09 UTC
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 (
Comment 4 Tomas Hurka 2014-07-28 10:24:39 UTC
Created attachment 148354 [details]
Proposed patch to fix this issue
Comment 5 Tomas Hurka 2014-07-28 10:28:30 UTC
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.
Comment 6 Marek Fukala 2014-07-29 11:44:48 UTC
Thanks Tome for your evaluation and the patch. I'll take a look at it.
Comment 7 Marek Fukala 2014-07-29 12:09:25 UTC
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
Comment 8 Vladimir Riha 2014-07-29 12:16:27 UTC
Of course, I'll test it tomorrow
Comment 9 Quality Engineering 2014-07-30 02:31:30 UTC
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
Comment 10 Tomas Hurka 2014-07-30 11:56:49 UTC
*** Bug 246123 has been marked as a duplicate of this bug. ***
Comment 11 Tomas Hurka 2014-07-30 15:58:59 UTC
*** Bug 246144 has been marked as a duplicate of this bug. ***
Comment 12 Vladimir Riha 2014-07-31 13:31:40 UTC
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)
Comment 13 Marek Fukala 2014-07-31 18:12:34 UTC
Thanks a lot