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 177052 - AWT thread blocked for 43234 ms.
Summary: AWT thread blocked for 43234 ms.
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Jiri Skrivanek
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2009-11-18 02:24 UTC by Exceptions Reporter
Modified: 2009-11-23 18:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 162372


Attachments
nps snapshot (256.00 KB, application/nps)
2009-11-18 02:24 UTC, Exceptions Reporter
Details
Proposed patch. (532 bytes, patch)
2009-11-19 07:14 UTC, Jiri Skrivanek
Details | Diff
Better fix with ConcurrentHashMap. (1.32 KB, text/plain)
2009-11-19 09:08 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2009-11-18 02:24:10 UTC
Build: NetBeans IDE 6.8 Beta (Build 200910212001)
VM: Java HotSpot(TM) Client VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01
OS: Windows XP, 5.1, x86

User Comments:
GUEST: NetBeans startup, then scanning projects starts automatically. My single project has five classes, a persistence unit, toplink and db2 jdbc driver linked. Scanning just takes ages. HDD has some load, but not much.


Maximum slowness yet reported was 43234 ms, average is 43234
Comment 1 Exceptions Reporter 2009-11-18 02:24:15 UTC
Created attachment 91223 [details]
nps snapshot
Comment 2 Tomas Zezula 2009-11-18 08:22:44 UTC
All the time spent on org.netbeans.core.startup.layers.ArchiveURLMapper's monitor.
Comment 3 Tomas Zezula 2009-11-18 08:23:58 UTC
Feel free to reassign to correct subcategory (core/startup). I haven't found it.
Comment 4 Jiri Skrivanek 2009-11-19 07:12:57 UTC
It is blocked in between synchronized methods ArchiveURLMapper.isRoot() and getFileSystem(). Because isRoot() is used only getURL() and it reads mountRoots, it doesn't seem to be necessary to be synchronized.
Comment 5 Jiri Skrivanek 2009-11-19 07:14:02 UTC
Created attachment 91348 [details]
Proposed patch.
Comment 6 Tomas Zezula 2009-11-19 07:33:55 UTC
The patch will work in nearly 100% cases at least on IA, but talking strictly it's not correct.
There are two problems:
1) Ordering
2) Visibility
The first is not so important in this case but the second may cause problems on HW with no so strong memory model as IA has. But even on the IA, where there is no visibility problem, there is a race.
The problem can be solved by changing the mountRoots to Collections.synchronizedMap or better to ConcurrentHashMap as it's lock free and there is no bulk operation on the mountRoots.
Comment 7 Jiri Skrivanek 2009-11-19 09:08:01 UTC
Created attachment 91363 [details]
Better fix with ConcurrentHashMap.
Comment 8 Tomas Zezula 2009-11-19 09:31:21 UTC
Seems good.
Thanks for the fix.
Comment 9 Jiri Skrivanek 2009-11-23 02:04:57 UTC
Fixed as suggested.
core-main #7a5c95ccced5
Comment 10 Quality Engineering 2009-11-23 18:09:55 UTC
Integrated into 'main-golden', will be available in build *200911231619* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/7a5c95ccced5
User: Jiri Skrivanek <jskrivanek@netbeans.org>
Log: #177052 - isRoot() don't need to be synchronized.