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 171327 - AWT thread blocked for 22225 ms.
Summary: AWT thread blocked for 22225 ms.
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Vitezslav Stejskal
URL: http://statistics.netbeans.org/except...
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2009-09-02 15:09 UTC by jmichelberger
Modified: 2009-10-15 10:02 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 157307


Attachments
nps snapshot (19.59 KB, bin/nps)
2009-09-02 15:09 UTC, jmichelberger
Details
nps snapshot (18.02 KB, bin/nps)
2009-10-07 07:32 UTC, Jaroslav Tulach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jmichelberger 2009-09-02 15:09:08 UTC
Build: NetBeans IDE Dev (Build nbms-and-javadoc-3829-on-090828)
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:
douglasv: grails


Maximum slowness yet reported was 22225 ms, average is 16474
Comment 1 jmichelberger 2009-09-02 15:09:15 UTC
Created attachment 86970 [details]
nps snapshot
Comment 2 Vitezslav Stejskal 2009-09-02 16:38:28 UTC
RepositoryUpdate.getOwningSourceRoot() is still slow - unfortunately in this case all its calls end up in native
java.io.WinNTFileSystem.getBooleanAttributes(). I assume that the machine's disk was busy doing something else. No
scanning or other editor tasks were running.

From my point of view this is pretty much WONTFIX, but maybe we could somehow cache owning source roots for files opened
in the editor.
Comment 3 Vitezslav Stejskal 2009-09-24 12:46:52 UTC
http://hg.netbeans.org/jet-main/rev/18bc593fd22c
Comment 4 Quality Engineering 2009-09-26 21:09:40 UTC
Integrated into 'main-golden', will be available in build *200909251401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/18bc593fd22c
User: Vita Stejskal <vstejskal@netbeans.org>
Log: #171327: caching owning source root on a Document instance
Comment 5 Jaroslav Tulach 2009-10-07 07:32:20 UTC
Build: NetBeans IDE Dev (Build 090914)
VM: Java HotSpot(TM) Client VM, 14.1-b02, Java(TM) SE Runtime Environment, 1.6.0_15-b03
OS: Linux, 2.6.29.6-desktop-1mnb, i386

User Comments: 

Maximum slowness yet reported was 22225 ms, average is 9074
Comment 6 Jaroslav Tulach 2009-10-07 07:32:25 UTC
Created attachment 88965 [details]
nps snapshot
Comment 7 dlipin 2009-10-13 14:17:29 UTC
reproduced in 6.8 M2, btw.
Comment 8 Jaroslav Tulach 2009-10-13 15:34:31 UTC
Looks like YAGL was hit. You cannot synchronize on the cache while doing I/O. This might be an improvement:

diff -r 27d0472b6376 parsing.api/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java
--- a/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java Tue Oct 13 12:52:22 2009 +0200
+++ b/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java Tue Oct 13 16:31:19 2009 +0200
@@ -3338,19 +3338,24 @@
         }

         public FileObject findFileObject(URL url) {
+            FileObject f = null;
             synchronized (cache) {
                 Reference<FileObject> ref = cache.get(url);
-                FileObject f = ref == null ? null : ref.get();
+                if (ref != null) {
+                    f = ref.get();
+                }
+            }

-                try {
-                    if (f != null && f.isValid() && url.equals(f.getURL())) {
-                        return f;
-                    }
-                } catch (FileStateInvalidException fsie) {
-                    // ignore
+            try {
+                if (f != null && f.isValid() && url.equals(f.getURL())) {
+                    return f;
                 }
-
-                f = URLMapper.findFileObject(url);
+            } catch (FileStateInvalidException fsie) {
+                // ignore
+            }
+            f = URLMapper.findFileObject(url);
+
+            synchronized (cache) {
                 if (f != null && f.isValid()) {
                     cache.put(url, new WeakReference<FileObject>(f));
                 }
Comment 9 Jaroslav Tulach 2009-10-13 15:35:12 UTC
My previous patch addresses problem as seen in
http://statistics.netbeans.org/exceptions/exception.do?id=277998
Comment 10 Vitezslav Stejskal 2009-10-13 18:01:48 UTC
Hmm, thanks for the patch Jardo.
Comment 11 Vitezslav Stejskal 2009-10-15 10:02:17 UTC
applied the patch, local changeset: 6afe6e6a7058