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 243483 - AWT thread hangs for several seconds after every editor save
Summary: AWT thread hangs for several seconds after every editor save
Status: RESOLVED DUPLICATE of bug 269095
Alias: None
Product: platform
Classification: Unclassified
Component: JDK Problems (show other bugs)
Version: 8.0
Hardware: PC Mac OS X
: P3 normal with 1 vote (vote)
Assignee: Antonin Nebuzelsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-02 15:37 UTC by ebakke
Modified: 2016-11-23 18:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
.npss file attached from NetBeans (551.15 KB, application/x-npss)
2014-04-02 15:38 UTC, ebakke
Details
.npss file attached from NetBeans (394.47 KB, application/x-npss)
2016-11-07 17:45 UTC, ebakke
Details
.npss file attached from NetBeans (225.69 KB, application/x-npss)
2016-11-12 00:57 UTC, ebakke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ebakke 2014-04-02 15:37:35 UTC
After working in the IDE for a while, saving a Java file causes the entire IDE to lock up for several seconds (very problematic). The only recourse is to restart the IDE, after which the problem will go away for a while--but it will be back after 15 minutes (very roughly).

My standard IDE use case when observing the bug is having 14 Maven-based NetBeans module projects open (all related to the same platform application), editing java files in some of the projects, and running the platform application using Compile-on-Save. Turning Compile-on-Save off for a moment did not stop the problem, though I am happy to do more experiments.

Will attach a profiler dump.
Comment 1 ebakke 2014-04-02 15:38:04 UTC
Created attachment 146503 [details]
.npss file attached from NetBeans

.npss file
Comment 2 ebakke 2014-04-02 15:38:42 UTC
This is on MacOS with Java 8 and NetBeans 8.0. The problem was also present in 7.4.


Product Version: NetBeans IDE 8.0 (Build 201403101706)
Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b70
Runtime: Java(TM) SE Runtime Environment 1.8.0-b132
System: Mac OS X version 10.9.2 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/ebakke/Library/Application Support/NetBeans/8.0
Cache directory: /Users/ebakke/Library/Caches/NetBeans/8.0
Comment 3 ebakke 2014-04-02 15:40:58 UTC
The npss dump I attached was taken while repeatedly saving a Java file with Command+S from the Java editor, adding one space to the file before every save (so, not introducing any new variables or similar).
Comment 4 ebakke 2014-04-02 15:44:02 UTC
If it's of any interest--the hang appears to happen right _after_ the save operation has completed. This means that the TopComponent tab for the edited file has time to un-bolden the filename to indicate that the file has been saved before the UI hangs.
Comment 5 Milos Kleint 2014-04-03 11:48:01 UTC
I see the AWT thread to end up in jdk related codebase, eg. in sun.java2d.SunGraphics2D.

Appears to be jdk8 related to me, do you experience the same issue when running on jdk 7?
Comment 6 ebakke 2014-04-03 14:24:14 UTC
Unsure--before running JDK8 I was running developer previews of JDK8, so even though I have seen this problem for a good while, it might still be JDK8-related. If you want I can try to downgrade to JDK7 for a while and see if the problem appears.
Comment 7 ebakke 2016-11-07 17:45:45 UTC
Created attachment 162813 [details]
.npss file attached from NetBeans

.npss file
Comment 8 ebakke 2016-11-07 17:51:39 UTC
I have continued to see this bug daily for the last two years--it usually happens when background project scanning happens during editing as a result of a method signature being changed or similar refactorings. I have learned to live with it--saving up lots of changes before pressing "Save All", or restarting the IDE when it gets too bad. It could be frustrating for users who aren't accustomed to this bug, though.

Attaching performance dump from the latest version of NetBeans and Java.

Product Version: NetBeans IDE 8.2 (Build 201609300101)
Java: 1.8.0_92; Java HotSpot(TM) 64-Bit Server VM 25.92-b14
Runtime: Java(TM) SE Runtime Environment 1.8.0_92-b14
System: Mac OS X version 10.9.5 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/ebakke/Library/Application Support/NetBeans/8.2
Cache directory: /Users/ebakke/Library/Caches/NetBeans/8.2
Comment 9 ebakke 2016-11-07 17:55:35 UTC
(The latest attached dump shows the hang at the end--when there is only 3 performance samples over 4 seconds.)
Comment 10 ebakke 2016-11-12 00:57:51 UTC
Created attachment 162882 [details]
.npss file attached from NetBeans

.npss file
Comment 11 ebakke 2016-11-12 00:59:28 UTC
The latest attachment is yet another good snapshot of this problem--this time it happened three times in a row within a few seconds, locking up the entire IDE after saving. Can be seen as three long periods in the stack depth chart with no samples.
Comment 12 ebakke 2016-11-23 18:53:21 UTC
I now think this bug is completely unrelated to the save action--it's a "background scanning of projects" problem, which can occur even when the IDE is completely idle. I've filed a new bug; will close this one.
https://netbeans.org/bugzilla/show_bug.cgi?id=269095

*** This bug has been marked as a duplicate of bug 269095 ***