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.
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
Created attachment 91223 [details] nps snapshot
All the time spent on org.netbeans.core.startup.layers.ArchiveURLMapper's monitor.
Feel free to reassign to correct subcategory (core/startup). I haven't found it.
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.
Created attachment 91348 [details] Proposed patch.
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.
Created attachment 91363 [details] Better fix with ConcurrentHashMap.
Seems good. Thanks for the fix.
Fixed as suggested. core-main #7a5c95ccced5
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.