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 173923 - AWT thread blocked for 4156 ms.
Summary: AWT thread blocked for 4156 ms.
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Lahoda
URL: http://statistics.netbeans.org/except...
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2009-10-07 06:05 UTC by Exceptions Reporter
Modified: 2010-10-11 11:34 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 156866


Attachments
nps snapshot (58.80 KB, bin/nps)
2009-10-07 06:05 UTC, Exceptions Reporter
Details
Current version of the patch. (10.20 KB, patch)
2009-10-09 10:33 UTC, Jan Lahoda
Details | Diff
Updated version of the patch - fixes a few mistakes (10.19 KB, patch)
2009-10-12 13:31 UTC, Jan Lahoda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2009-10-07 06:05:17 UTC
Build: NetBeans IDE Dev (Build nbms-and-javadoc-4007-on-090929)
VM: Java HotSpot(TM) Client VM, 14.0-b16, Java(TM) SE Runtime Environment, 1.6.0_14-b08
OS: Windows XP, 5.1, x86

User Comments:
j0ni: changing project group.

velodiver: opening a project

GUEST: opening project


Maximum slowness yet reported was 9641 ms, average is 5110
Comment 1 Exceptions Reporter 2009-10-07 06:05:24 UTC
Created attachment 88959 [details]
nps snapshot
Comment 2 Exceptions Reporter 2009-10-07 06:05:29 UTC
This issue already has 6 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=156866
Comment 3 mslama 2009-10-08 15:04:49 UTC
Do not call CloneableEditor.getEditorPane because it blocks when editor initialization is in progress.
NbDocument.findRecentEditorPane(EditorCookie) is non blocking alteranative. Then listen to EditorCookie.Observable.
Comment 4 Jan Lahoda 2009-10-09 10:32:45 UTC
I tried to implement that (see attachment). I had to use heavy artillery to workaround the slow CES.Pane.getEditorPane
while (hopefully) preserving the behavior. Result is less predictable, more difficult to maintain, consumes more memory
and is slower (on each invocation, not only if the editor is being initialized) than the original solution with "fast"
(i.e. original) getEditorPane() method, but is the only reasonable solution I found so far (I tried several other
solutions, but they either do not work, or, in one case, I am afraid of serious functional regressions). So, I would
like to request a performance review of this patch. Please also check that the methods I call in AWT thread are OK to be
called there (e.g.
TopComponent.getLookup().lookup(DataObject.class|FileObject.class|Node.class.getLookup().lookup(DataObject.class,
FileObject.class, Node.class.getLookup()..., EditorCookie.Observable.{add|remove}PropertyChangeListener, etc.). Please
provide guidance on how to implement the workaround better (ideally by improving the patch), if the current patch is not
good enough.

The patch also improves two warning messages in openide.text and adds two warnings to CES.Pane.getEditorPane(). Is there
a case where the method can be used? If not, I suggest to deprecate the method altogether.

Thanks.
Comment 5 Jan Lahoda 2009-10-09 10:33:39 UTC
Created attachment 89170 [details]
Current version of the patch.
Comment 6 Jan Lahoda 2009-10-12 13:31:07 UTC
Created attachment 89309 [details]
Updated version of the patch - fixes a few mistakes
Comment 7 Jan Lahoda 2009-10-12 13:33:36 UTC
I have attached an updated version of the patch (prevents infinite recursion in DataObject lookup, fixes two other
mistakes I found while testing the lazy loading).
Comment 8 Jan Lahoda 2010-10-11 11:34:11 UTC
Was resolved long time ago, AFAIK.