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.
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.
Created attachment 146503 [details] .npss file attached from NetBeans .npss file
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
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).
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.
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?
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.
Created attachment 162813 [details] .npss file attached from NetBeans .npss file
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
(The latest attached dump shows the hang at the end--when there is only 3 performance samples over 4 seconds.)
Created attachment 162882 [details] .npss file attached from NetBeans .npss file
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.
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 ***