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 211618

Summary: 15s - to create SAX parser in a background thread blocks other threads
Product: platform Reporter: tnleeuw <tnleeuw>
Component: -- Other --Assignee: Antonin Nebuzelsky <anebuzelsky>
Status: RESOLVED WONTFIX    
Severity: normal CC: issues, MrJxN
Priority: P4 Keywords: PERFORMANCE
Version: 7.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 187320
Attachments: nps snapshot

Description tnleeuw 2012-04-24 07:48:00 UTC
This bug was originally marked as duplicate of bug 177784, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201204220400)
VM: Java HotSpot(TM) Client VM, 20.6-b01, Java(TM) SE Runtime Environment, 1.6.0_31-b05
OS: Windows Vista
Maximum slowness yet reported was 4144 ms, average is 4144
Comment 1 tnleeuw 2012-04-24 07:48:06 UTC
Created attachment 118674 [details]
nps snapshot
Comment 2 Jaroslav Tulach 2012-04-24 09:25:57 UTC

org.netbeans.modules.editor.MainMenuAction$FormatAction.getGlobalKitAction()	98.99213	3 978 ms (99%)	0,000 ms	1

while calling into 

org.openide.filesystems.DefaultAttributes.readAttribute()	98.99213	3 978 ms (99%)	0,000 ms	1


meanwhile in parsing API:

org.netbeans.modules.html.editor.hints.HtmlHintsProvider.computeErrors()	100.0	4 018 ms (100%)	4 018 ms	1


and in pending refresh:
org.netbeans.modules.maven.j2ee.web.WebCopyOnSave$FileListenerImpl.fileDeleted()	30.46182	1 224 ms (30,5%)	1 224 ms	74
org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectKeeper.fileDeleted()	14.052246	564 ms (14,1%)	564 ms	53
org.netbeans.modules.parsing.impl.indexing.errors.ErrorAnnotator$RootAddedDeletedListener.fileDeleted()	10.303086	414 ms (10,3%)	414 ms	42
Comment 3 Jaroslav Tulach 2012-06-04 08:06:42 UTC
One report only. Not much to do with this case anyway.
Comment 4 Alexander Simon 2012-12-13 08:18:19 UTC
Please reevaluate bug (10 duplicates).
Comment 5 Jaroslav Tulach 2013-01-23 16:15:48 UTC
In case of 
http://statistics.netbeans.org/exceptions/exception.do?id=625295
the EDT waits for attributes which seem to be read by parsing thread:
org.netbeans.core.startup.layers.LocalFileSystemEx$DelegatingAttributes.readAttribute()	100.0	11,238 ms (100%)	11,238 ms	1

The same applies to
http://statistics.netbeans.org/exceptions/exception.do?id=629911
just the background thread is Palette Switch:
org.netbeans.core.startup.layers.LocalFileSystemEx$DelegatingAttributes.readAttribute()	100.0	7,191 ms (100%)	7,191 ms
Comment 6 Jaroslav Tulach 2013-07-18 08:38:29 UTC
http://statistics.netbeans.org/exceptions/exception.do?id=678976

The parsing thread is busy with parsing about 14 editor XML files. The EDT is blocked in DefaultAttributes which seem to be processed by "main-class-updater" thread. 

The problem is that org.openide.xml.XMLUtil.createXMLReader() is synchronized and that org.apache.xerces.parsers.ObjectFactory.findJarServiceProvider() seems to open (all!?) JARs to find out where XML reader provider is.

In any case this looks like an overloaded system with slow classloading. Making P4. Possible fix might be the make XMLUtils more efficient. Moving to other category.