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 174050 - 30s - too much time in WeakSet.equals
Summary: 30s - too much time in WeakSet.equals
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker with 1 vote (vote)
Assignee: Jaroslav Tulach
URL: http://statistics.netbeans.org/except...
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2009-10-08 09:58 UTC by Peter Nabbefeld
Modified: 2010-04-09 08:30 UTC (History)
11 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 158156


Attachments
nps snapshot (5.67 KB, bin/nps)
2009-10-08 09:58 UTC, Peter Nabbefeld
Details
nps snapshot (7.43 KB, bin/nps)
2009-10-08 10:28 UTC, Peter Nabbefeld
Details
nps snapshot (256.00 KB, application/nps)
2009-12-12 21:10 UTC, cemerick
Details
Threaddump from VisualVM (21.76 KB, text/plain)
2010-02-11 03:43 UTC, Jiri Sedlacek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Nabbefeld 2009-10-08 09:58:27 UTC
Build: NetBeans IDE Dev (Build 200910061401)
VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_05-b13
OS: Windows XP, 5.1, x86

User Comments:
jasondonmoyer: I tried to expand a node in the Search Results tab that contained 39 matches in 10 files

jasondonmoyer: I issued a search for a string across all files in all of my open projects

jasondonmoyer: I used Alt+shift+o to open three properties files and after they were opened, I attempted to click on the editor window tab to switch focus to one of them.

jasondonmoyer: Attempting to edit xml in the editor


Maximum slowness yet reported was 30687 ms, average is 13920
Comment 1 Peter Nabbefeld 2009-10-08 09:58:32 UTC
Created attachment 89078 [details]
nps snapshot
Comment 2 Exceptions Reporter 2009-10-08 09:58:37 UTC
This issue already has 7 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=158156
Comment 3 Peter Nabbefeld 2009-10-08 10:28:30 UTC
Build: NetBeans IDE Dev (Build 200910061401)
VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_05-b13
OS: Windows XP, 5.1, x86

User Comments: 

Maximum slowness yet reported was 69656 ms, average is 20887
Comment 4 Peter Nabbefeld 2009-10-08 10:28:34 UTC
Created attachment 89080 [details]
nps snapshot
Comment 5 Exceptions Reporter 2009-10-08 10:28:39 UTC
This issue already has 8 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=158156
Comment 6 Jiri Skrivanek 2009-10-08 13:57:20 UTC
I wonder how can 61 second be spent in org.openide.util.WeakSet$Entry.equals(). Can someone experienced help me? There
is a lock in collectForRefresh for which AWT thread is waiting. But just adding to WeakSet should not take so much time IMO.

org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectFactory.collectForRefresh()
  org.openide.util.WeakSet.add()
    org.openide.util.WeakSet.object2Entry()
      org.openide.util.WeakSet$Entry.equals() 61282060	723
Comment 7 Peter Nabbefeld 2009-10-08 14:18:25 UTC
One Problem might be, that I've got a project with sources on a mapped device (Windows!). These sources are mainly for
reference only and rarely change. I'm not allowed to copy them for some reasons I'll not discuss here. So, at least in
my case, it would be perfect to scan these sources only on demand.

It would be helpful, if I could flag single source paths as not to be scanned automatically, and having an ant task to
force scanning (this would help to automate scanning under certain conditions, e.g. to create an "Activate" task, which
would automatically do rescanning after propagating project artifacts when project is finished).
Comment 8 Jaroslav Tulach 2009-10-13 15:39:35 UTC
Looking at
http://statistics.netbeans.org/exceptions/exception.do?id=277805
I can see YAGL in FileObjectFactory. Background thread doing refresh for 27s blocks AWT which only wants to consult 
the cache in getCachedOnly
Comment 9 Jiri Skrivanek 2009-10-14 09:21:52 UTC
Yes, that I said in #desc7. But I don't know why time is spent in org.openide.util.WeakSet$Entry.equals().
Comment 10 cemerick 2009-12-12 21:10:19 UTC
Created attachment 92469 [details]
nps snapshot

adding a maven dependency via the UI
Comment 11 Jiri Sedlacek 2010-02-11 03:41:26 UTC
Product Version: NetBeans IDE 6.8 (Build 200912041610)
Java: 1.6.0_18; Java HotSpot(TM) Client VM 16.0-b13
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)


I've just experienced a blocked EDT for more than 1 minute (reported as http://statistics.netbeans.org/analytics/exception.do?id=337128). Raising to P2.


Steps:

 1/ In Favorites view I've invoked a Find for all "*.png" files in local NetBeans hg repository
 2/ I've continued my normal work in the IDE, progress showed "Preparing data for searching..."
 3/ I've tried to switch to another editor window by clicking the TopComponent caption, IDE became unresponsive
Comment 12 Jiri Sedlacek 2010-02-11 03:43:06 UTC
Created attachment 94069 [details]
Threaddump from VisualVM
Comment 13 Jaroslav Tulach 2010-03-12 13:11:10 UTC
Probably fixed in core-main#042b1adfe883 - the WeakSet's initial size is now much bigger and thus (according to comment in bug 170556), the number of equals operations shall significantly drop.
Comment 14 Petr Jiricka 2010-04-09 08:30:07 UTC
Saw this again in today's build: http://statistics.netbeans.org/analytics/exception.do?id=368427