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 122840 - Editing XML hangs (uses 100% cpu)
Summary: Editing XML hangs (uses 100% cpu)
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF (show other bugs)
Version: 6.x
Hardware: Macintosh All
: P2 blocker with 3 votes (vote)
Assignee: Joelle Lam
URL:
Keywords:
: 123219 126347 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-11-27 12:43 UTC by pinheiro
Modified: 2009-11-10 06:46 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot of the process using 100% cpu (21.17 KB, image/png)
2007-11-27 12:44 UTC, pinheiro
Details
Thread dump, as requested. (11.07 KB, text/plain)
2007-11-27 15:54 UTC, pinheiro
Details
New threaddump (17.43 KB, text/plain)
2007-11-27 17:58 UTC, pinheiro
Details
Another threaddump (15.96 KB, text/plain)
2007-11-27 17:59 UTC, pinheiro
Details
Thread Dump (11.59 KB, text/plain)
2007-11-30 19:08 UTC, fincatto
Details
Thread Dump JSF file (19.49 KB, text/plain)
2007-11-30 19:18 UTC, fincatto
Details
First threaddump from Dev 200711291200 daily build (11.78 KB, text/plain)
2007-11-30 20:36 UTC, pinheiro
Details
Second threaddump from Dev 200711291200 daily build (11.02 KB, text/plain)
2007-11-30 20:37 UTC, pinheiro
Details
Thread dump from 6.0 final (7.59 KB, text/plain)
2007-12-04 11:15 UTC, pinheiro
Details
Dump in moment of XML is open. (24.40 KB, text/plain)
2007-12-12 13:59 UTC, fincatto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pinheiro 2007-11-27 12:43:20 UTC
While editing a XML file with around 670 lines it hangs and uses 100% cpu.
Most of times after a 10 second delay it continues working ok. Sometimes after 5 minutes it continues using 100% cpu.

The XML is a JSF config file, only with managed beans declarations.
Comment 1 pinheiro 2007-11-27 12:44:05 UTC
Created attachment 53543 [details]
Screenshot of the process using 100% cpu
Comment 2 pinheiro 2007-11-27 13:18:52 UTC
I'm rearranging the file, so doing some cutting and pasting to reorder the declarations.
When I copy some block, after clicking somewhere in the file (to try to paste) it hangs...
Comment 3 Jiri Prox 2007-11-27 14:46:16 UTC
Can you please capture several threaddumps when CPU goes on 100%? 
Comment 4 pinheiro 2007-11-27 15:54:14 UTC
Created attachment 53555 [details]
Thread dump, as requested.
Comment 5 pinheiro 2007-11-27 17:58:38 UTC
Created attachment 53565 [details]
New threaddump
Comment 6 pinheiro 2007-11-27 17:59:27 UTC
Created attachment 53566 [details]
Another threaddump
Comment 7 pinheiro 2007-11-27 18:01:04 UTC
I've added two new threaddumps, from different moments. I think now it is complete.
Ask me if you need more info, as I think that this one is very important for the final release.
Comment 8 Marek Fukala 2007-11-28 08:32:46 UTC
In all the threaddumps, the CPU still processes org.netbeans.modules.web.jsf.navigation.* code, reassigning...
Comment 9 Petr Pisl 2007-11-28 10:34:22 UTC
This is pageflow editor issue. Reassigning. Joelle, could you look at this?
Comment 10 fincatto 2007-11-28 10:40:27 UTC
I believe that all issues and memory leaks (outOfMemory heap) that have reported are directly related to this component.
Comment 11 fincatto 2007-11-28 10:42:00 UTC
I believe that all issues and memory leaks (outOfMemory heap) that have reported are directly related to this component.
Comment 12 Joelle Lam 2007-11-28 15:41:05 UTC
First going to write unit tests to see what is not getting garbage collected.
Comment 13 Joelle Lam 2007-11-28 16:42:34 UTC
Found one, but will continue to look for more.. Also added Unit Test.

IDE:-------------------------------------------------
IDE: [11/28/07 8:40 AM] Committing "Page Flow Editor" started
Checking in src/org/netbeans/modules/web/jsf/navigation/PageFlowController.java;
/cvs/web/jsf/navigation/src/org/netbeans/modules/web/jsf/navigation/PageFlowController.java,v  <--  PageFlowController.java
new revision: 1.145; previous revision: 1.144
done
Checking in src/org/netbeans/modules/web/jsf/navigation/PageFlowView.java;
/cvs/web/jsf/navigation/src/org/netbeans/modules/web/jsf/navigation/PageFlowView.java,v  <--  PageFlowView.java
new revision: 1.123; previous revision: 1.122
done
Checking in test/unit/src/org/netbeans/modules/web/jsf/navigation/PageFlowControllerTest.java;
/cvs/web/jsf/navigation/test/unit/src/org/netbeans/modules/web/jsf/navigation/PageFlowControllerTest.java,v  <-- 
PageFlowControllerTest.java
new revision: 1.14; previous revision: 1.13
done
IDE: [11/28/07 8:40 AM] Committing "Page Flow Editor" finished
Comment 14 Joelle Lam 2007-11-29 23:38:22 UTC
I have also added a modification that makes it so the graph doesn't update until it is showing.  These fixes have been
committed to the trunk.  Please let me know if you would like a jar file to test this out.
Comment 15 Joelle Lam 2007-11-29 23:39:06 UTC
IDE:-------------------------------------------------
IDE: [11/29/07 3:38 PM] Committing "Page Flow Editor" started
Checking in PageFlowController.java;
/cvs/web/jsf/navigation/src/org/netbeans/modules/web/jsf/navigation/PageFlowController.java,v  <--  PageFlowController.java
new revision: 1.146; previous revision: 1.145
done
Checking in JSFPageFlowMultiviewDescriptor.java;
/cvs/web/jsf/navigation/src/org/netbeans/modules/web/jsf/navigation/JSFPageFlowMultiviewDescriptor.java,v  <-- 
JSFPageFlowMultiviewDescriptor.java
new revision: 1.41; previous revision: 1.40
done
Checking in FacesModelPropertyChangeListener.java;
/cvs/web/jsf/navigation/src/org/netbeans/modules/web/jsf/navigation/FacesModelPropertyChangeListener.java,v  <-- 
FacesModelPropertyChangeListener.java
new revision: 1.30; previous revision: 1.29
done
Checking in PageFlowView.java;
/cvs/web/jsf/navigation/src/org/netbeans/modules/web/jsf/navigation/PageFlowView.java,v  <--  PageFlowView.java
new revision: 1.125; previous revision: 1.124
done
Comment 16 fincatto 2007-11-30 19:08:09 UTC
Created attachment 53733 [details]
Thread Dump
Comment 17 fincatto 2007-11-30 19:10:51 UTC
Testing with the version dev 200711291200, the problem persists.
Attached the dump when the netbeans was locked (frozen).
Comment 18 fincatto 2007-11-30 19:14:48 UTC
How disable the pageflow? In large files it freezes the IDE for some seconds (Maaany seconds).
Comment 19 fincatto 2007-11-30 19:18:56 UTC
Created attachment 53734 [details]
Thread Dump JSF file
Comment 20 fincatto 2007-11-30 19:23:51 UTC
The "Fri Nov 30 19:18:00 +0000 2007: threaddump.netbeans2" file refers to the editing of a JSF. The former was an XML.
Comment 21 pinheiro 2007-11-30 20:35:49 UTC
I've downloaded the daily build Dev 200711291200 and it is still slow.
However, it is much faster than before.

Before, I cannot continue editing the XML, as I said, for more than 10 minutes (most of the time I killed netbeans
without saving work).
Now after 40s - 1m it is ok to continue editing.

We're almost there. I'll upload two new threaddumps from this new version.
Comment 22 pinheiro 2007-11-30 20:36:49 UTC
Created attachment 53738 [details]
First threaddump from Dev 200711291200 daily build
Comment 23 pinheiro 2007-11-30 20:37:40 UTC
Created attachment 53739 [details]
Second threaddump from Dev 200711291200 daily build
Comment 24 pinheiro 2007-11-30 20:39:32 UTC
We've tested in a Linux 7.10 Gutsy Gibbon and the same occurred. Changing OS to "All".
Comment 25 Joelle Lam 2007-11-30 21:20:09 UTC
Are you switching back and forth between the Page Flow View and the XML view?  I am not sure why this thread is getting
called. The new code should basically turn off the Page Flow Editor from loading stuff until the Page Flow Editor is
showing.
Comment 26 pinheiro 2007-11-30 21:48:22 UTC
No. When I open this XML (with no navigation-rules, only managed-beans declarations), it opens in XML editor.
Simply go anywhere in the text, cut and then go somewhere else and try to paste... and wait.
Comment 27 Joelle Lam 2007-11-30 21:56:48 UTC
I have created another issue #123193 which deals with the Low Memory for editing JSF ( I have attached fincatt's Thread
Dump in that issue as well).
Comment 28 Joelle Lam 2007-11-30 22:06:40 UTC
Hello pinheiro, I think I know what the issue is.  I took a look at your thread dump and it seems that the changes
weren't picked up in the daily build (your line numbers are obsolete with what I have).  Can you try today's daily
build.  The 29th commit may have been after the snapshot.  If you were using 200711191200 ( I presume that means it was
take a 0 1200 ) while my commit was finalized at 0 23:39.  Can you please confirm? 

I think that is why Fincatto is seeing something else.  His issues seemed to be caused by the JSF module itself and not
Page Flow Editor.  I will make one more commit tonight (which you won't need) to try to further release the AWT Event
Queue while things are being edited, but I don't think this is caused by Page Flow Editor.
Comment 29 pinheiro 2007-12-04 11:03:29 UTC
Joellelam: I'm using the 6.0 released yesterday and I think that it does not include your patch.
I'll attach another thread dump.
Later, I'll download the development release to check it out.
Comment 30 pinheiro 2007-12-04 11:15:12 UTC
Created attachment 53830 [details]
Thread dump from 6.0 final
Comment 31 Joelle Lam 2007-12-04 19:33:31 UTC
Thanks Pinheiro: Your new thread dump do not point to Page Flow Editor at all.  I am closing this issue as resolved. 
You may want to watch issue #123193 that is currently assigned to Petr.  I have attached your dump to that issue as
well.  If you run into anymore thread dumps that have the words "navigation" in them, you can re-open this bug. 
Comment 32 fincatto 2007-12-12 13:58:36 UTC
The XML editor still slow on the build DEV200712050000. Now, the paste command is ok. But, when the file is opened, the
use of the CPU goes to 100%.
Comment 33 fincatto 2007-12-12 13:59:33 UTC
Created attachment 54194 [details]
Dump in moment of XML is open.
Comment 34 Joelle Lam 2007-12-12 21:36:23 UTC
How long does it stay at 100%?  I also need successive thread dumps (at least 3).  Thanks!
Comment 35 Joelle Lam 2008-01-11 19:04:01 UTC
Have not received a response... Assuming original fix worked.  If there you are seeing something new, it may be best to
open a new bug so to clear things out. 
Comment 36 Joelle Lam 2008-01-30 05:06:30 UTC
*** Issue 123219 has been marked as a duplicate of this issue. ***
Comment 37 Joelle Lam 2008-01-31 18:20:16 UTC
*** Issue 126347 has been marked as a duplicate of this issue. ***
Comment 38 martin_zmrhal 2008-11-26 09:46:50 UTC
Could not reproduce anything from described behaviour, marking as verified

Product Version: NetBeans IDE Dev (Build 200811260201)
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Linux version 2.6.27-7-generic running on i386; UTF-8; en_US (nb)