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.
[ JDK VERSION : 1.6.0_02 ] Favorites Window UI responsiveness breaking UI guidelines and AWT thread blocked by Node opening (At first time when IDE open) Steps : 1: add some large folder structure like Netbeans src folder 2:try to open it will take 1 min and 30s (first time )
Product Version: NetBeans IDE Dev (Build 071016) Java: 1.6.0_05-ea; Java HotSpot(TM) Client VM 1.6.0_05-ea-b04 System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb) And T2300 at 1.66Ghz and 2GB ram
More Details : First Time (after OS boot) It take 1Min and 30s After close Ide and open it again only take 8s But again restart OS and try to open node take 1Min and 30s (Anyway computing children should be off from AWT Thread )
I will profile IDE. Yes it can take long time because underlying code can do a lot of work (loaders detect file type for every file/folder, in case expanded folder contains NB projects it is even worse). I do not know if it is possible to perform node expansion asynchronously ie. avoid blocking AWT. I will investigate.
apisupport blocks AWT thread in special case when expanded folder contains nb projects. Thread dump attached.
Created attachment 51191 [details] Thread dump
I have profiler snapshot but it has ~2MB - too big to attach it here. If anyone is interested I can provide it.
Roughly similar to issue #114155. In general: yes performance of apisupport on nb.org sources is slow, just wait for it, it is not considered a priority to address. *** This issue has been marked as a duplicate of 114155 ***
Well, I can't agree. This is completly different story, the AWT thread is blocked for a minute or so, that would be considered a deadlock and a reason to kill the IDE by most users. FYI: I have run into this problem several times myself. Maybe the error annotator should be more careful?
There's no component for tasklist so reassigning to java/source for evaluation.
In this case the request for the classpath _is_ being done on another thread; EQ is blocking on Sources.getSourceGroups. (Not clear if that could be moved to the other thread also?) Now apisupport's Evaluator already has an optimization that it will not wait for the full ModuleList to be loaded in case you just ask for a property which does not need that. However another thread is asking for the classpath, which does need ModuleList and is thus loading it, and access to the delegating evaluator is synchronized for thread safety. I could probably tweak the synchronization strategy to avoid this, but I have no idea if this is reproducible.
Anyone who has observed this, see if the following helps: Checking in Evaluator.java; /shared/data/ccvs/repository/apisupport/project/src/org/netbeans/modules/apisupport/project/Evaluator.java,v <-- Evaluator.java new revision: 1.29; previous revision: 1.28 done
Checking in ErrorAnnotator.java; /cvs/java/source/src/org/netbeans/modules/java/source/tasklist/ErrorAnnotator.java,v <-- ErrorAnnotator.java new revision: 1.7; previous revision: 1.6 done
FYI: The easiest way to reproduce this (although not a typical use case) was to start the IDE with no NB projects opened and navigate the Favorites explorer to the folder with NetBeans sources. I'll try to verify this later.
Verified
I can verify that the AWT blockage is gone. But when I tried it, I realized that the scanPossibleProject() was called twice for each subfolder (I had a timestamping println added to ModuleList)! I started the IDE with new userdir, opened favorites, navigated to nball (which expanded quite quickly and then started the scan in the background) and after a while I also expanded one of the subfolders. Once the first scan finished ("findOrCreateModuleListFromNetBeansOrgSources took 61960ms" in my log file), another round of project folder scan followed, this time not originating from findOrCreateModuleListFromNetBeansOrgSources. I can attach my log file.