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 203092 - 5min in debugger.jpda.projects.SourcePathProviderImpl$PathRegistryListener.pathsAdded()
Summary: 5min in debugger.jpda.projects.SourcePathProviderImpl$PathRegistryListener.pa...
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 7.1
Hardware: All Unix
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-04 20:12 UTC by Vladimir Voskresensky
Modified: 2011-11-04 15:02 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
snapshot (45.45 KB, application/octet-stream)
2011-10-04 20:13 UTC, Vladimir Voskresensky
Details
5 minutes and zero opened projects (114.46 KB, application/octet-stream)
2011-11-01 15:58 UTC, Vladimir Voskresensky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2011-10-04 20:12:10 UTC
In recent dev builds I observe very long time between "Open" action on project from suite's modules till project is really seen in list of projects. No progress bar is shown, but cursor is changed to "clock"
Comment 1 Vladimir Voskresensky 2011-10-04 20:13:15 UTC
Created attachment 111480 [details]
snapshot

snapshot between "Open" action and project is visible in Projects list
Comment 2 Vladimir Voskresensky 2011-10-07 11:44:47 UTC
I was waiting for 5 minutes to open libraries of cnd.kit
After 5 minutes one file of one of modules was opened, but module itself is still invisible in Project list
Can someone evaluate this issue?

all the time I see jpda.projects.SourcePathProviderImpl in stack

"org.netbeans.modules.apisupport.project.ui.LibrariesNode" daemon prio=3 tid=0x0a308000 nid=0x8a4 runnable [0x705fe000]
   java.lang.Thread.State: RUNNABLE
        at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
        at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:228)
        at java.io.File.isDirectory(File.java:754)
        at java.io.File.toURI(File.java:661)
        at org.openide.filesystems.FileUtil.toFileObject(FileUtil.java:1026)
        at org.openide.filesystems.FileUtil$Holder.locateCurrent(FileUtil.java:419)
        at org.openide.filesystems.FileUtil$Holder.<init>(FileUtil.java:412)
        at org.openide.filesystems.FileUtil.addFileChangeListener(FileUtil.java:284)
        - locked <0x83183560> (a java.util.WeakHashMap)
        at org.netbeans.api.java.classpath.ClassPath$RootsListener.addRoots(ClassPath.java:1177)
        - locked <0x80928ac0> (a org.netbeans.api.java.classpath.ClassPath$RootsListener)
        at org.netbeans.api.java.classpath.ClassPath.createRoots(ClassPath.java:330)
        at org.netbeans.api.java.classpath.ClassPath.getRoots(ClassPath.java:268)
        - locked <0x85ce4ef0> (a org.netbeans.api.java.classpath.ClassPath)
        at org.netbeans.modules.debugger.jpda.projects.SourcePathProviderImpl$PathRegistryListener.pathsAdded(SourcePathProviderImpl.java:1447)
        - locked <0x8d372738> (a org.netbeans.modules.debugger.jpda.projects.SourcePathProviderImpl)
        at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerImpl.java:459)
        at $Proxy5.pathsAdded(Unknown Source)
        at org.netbeans.api.java.classpath.GlobalPathRegistry.register(GlobalPathRegistry.java:211)
        at org.netbeans.modules.apisupport.project.NbModuleProject.open(NbModuleProject.java:759)
        at org.netbeans.modules.apisupport.project.NbModuleProject$OpenedHook.projectOpened(NbModuleProject.java:705)
        at org.netbeans.spi.project.ui.ProjectOpenedHook$1.projectOpened(ProjectOpenedHook.java:84)
        at org.netbeans.spi.project.ui.support.UILookupMergerSupport$OpenHookImpl.projectOpened(UILookupMergerSupport.java:196)
        at org.netbeans.spi.project.ui.ProjectOpenedHook$1.projectOpened(ProjectOpenedHook.java:84)
        at org.netbeans.modules.project.ui.OpenProjectList.notifyOpened(OpenProjectList.java:1115)
        at org.netbeans.modules.project.ui.OpenProjectList.doOpenProject(OpenProjectList.java:1196)
        at org.netbeans.modules.project.ui.OpenProjectList.doOpen(OpenProjectList.java:683)
        at org.netbeans.modules.project.ui.OpenProjectList.open(OpenProjectList.java:587)
        at org.netbeans.modules.project.ui.OpenProjectList.open(OpenProjectList.java:552)
        at org.netbeans.modules.project.ui.OpenProjectsTrampolineImpl.openAPI(OpenProjectsTrampolineImpl.java:75)
        at org.netbeans.api.project.ui.OpenProjects.open(OpenProjects.java:180)
        at org.netbeans.modules.apisupport.project.ui.LibrariesNode$OpenProjectAction$1.run(LibrariesNode.java:578)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1973)
Comment 3 Vladimir Voskresensky 2011-10-07 11:45:57 UTC
I have to say that two "Checking for external changes" progress bars are in Suspended mode
Comment 4 Tomas Zezula 2011-10-07 13:43:53 UTC
Vladimir, what OS are you using?
The Checking for external changes should not exist for platforms which have native notifier (Win, Mac, Linux, Solaris).
Comment 5 Tomas Zezula 2011-10-07 14:04:53 UTC
It's Linux, I've found it in nps file.
Seems as jpda SourcePathProviderImpl.PathRegistryListener which forces immediate conversion of URLs to FileObjects.
I will look at the code and reassign.
Comment 6 Vladimir Voskresensky 2011-10-07 15:53:02 UTC
You are right. 
"Checking..." is on Solaris, but I have the same issue on Linux and snapshot is from Linux
Comment 7 Tomas Zezula 2011-10-07 19:10:45 UTC
I've looked at the snapshot and here is what I've found:
Debugger org.netbeans.modules.debugger.jpda.projects.SourcePathProviderImpl.PathRegistryListener.pathsAdded() is forcing the ClassPaths to create FileObjects. I am not sure if it's needed if the cheap URLs are not enough. But it seems that it's an old code. This thread is active for 48 sec. This thread is delayed by the second IO intensive thread running for 43sec. This thread does the "Checking for external changes" and blocks the first one and others.

As far as I know the checking for external changes should not be done in NB 7.1 (at least the issue #197985 is closed as fixed). Currently I don't see any solution for JPDA how to solve this except of using runPriorityIO as the parsing.api does. But the runPriorityIO is not a public API.
Comment 8 Jaroslav Tulach 2011-10-12 12:05:26 UTC
"second I/O intensive thread running for 43s" - that is the "Inacctive RP was: AnnotationHolder", right? That is no scan for external changes! It is the Watcher, something really huge had to change on the filesystem when it tries to refresh 1000 files.

To continue to blame masterfs, please run with -J-Dorg.netbeans.modules.masterfs.watcher.level=FINEST, so we at least know what the thread is trying to refresh.
Comment 9 Vladimir Voskresensky 2011-10-12 15:19:58 UTC
I see it again on Solaris after start/finish debug session
Have to restart IDE to have a chance to open projects in predictable time frame...
Comment 10 Vladimir Voskresensky 2011-11-01 15:54:48 UTC
I closed all projects, waited till Checking for external changed has finished.
Opened cnd.kit
when it appeared in Projects view I selected all C/C++ modules from it's Modules list and asked to open them.
Then I started profiler and after 5 minutes (no project so far are opened) I took snapshot.
Please, find it attached.
Comment 11 Vladimir Voskresensky 2011-11-01 15:58:21 UTC
Created attachment 112689 [details]
5 minutes and zero opened projects
Comment 12 Vladimir Voskresensky 2011-11-01 16:01:41 UTC
important comment:
I quite often see issues with opening projects after using debugger.
I.e. I debug 7.0.1 based project, then finish debugging, close all modules, then trying to switch to trunk. 
During opening trunk modules I face the issue with long (non)opening modules
Comment 13 Vladimir Voskresensky 2011-11-01 16:13:33 UTC
Please, evaluate this bug. 5 minutes without any feedback from IDE what it is doing is too long. 
The only good thing is that IDE is not frozen, but it's not a big advantage, because I can do nothing: no possibility to open project, files which appears in editor are jumps as they want, really something funny
Comment 14 Jaroslav Tulach 2011-11-02 19:07:00 UTC
The snapshot shows 66 calls to org.netbeans.modules.debugger.jpda.projects.SourcePathProviderImpl$PathRegistryListener.pathsAdded() which result in 4000 calls to disk I/O.
Comment 15 Martin Entlicher 2011-11-03 15:22:28 UTC
Fixed by changeset:   206193:a130b52ac3d2
http://hg.netbeans.org/main/rev/a130b52ac3d2
Comment 16 Quality Engineering 2011-11-04 15:02:45 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/a130b52ac3d2
User: mentlicher@netbeans.org
Log: #203092: Performance of PathRegistryListener improved. URL is used instead of FileObject and class path changes are collected first and then processed lazily.