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 87024 - Performance: IDE consumes 100% of CPU.
Summary: Performance: IDE consumes 100% of CPU.
Status: RESOLVED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Marek Fukala
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2006-10-12 19:40 UTC by Samaresh Panda
Modified: 2007-06-13 22:52 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
OTA Schema (816.69 KB, text/plain)
2006-10-16 22:59 UTC, Samaresh Panda
Details
console messages (4.98 KB, text/plain)
2006-10-16 23:00 UTC, Samaresh Panda
Details
thread dump (34.66 KB, application/octet-stream)
2006-10-16 23:00 UTC, Samaresh Panda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Samaresh Panda 2006-10-12 19:40:52 UTC
This is related to http://www.netbeans.org/issues/show_bug.cgi?id=86942. While
working on 86942, I discovered that another issue I filed earlier has
resurfaced. That earlier issue was
http://www.netbeans.org/issues/show_bug.cgi?id=75588.

Normally I'm not able to reproduce 75588, however when you refactor
TPA_Extensions in OTA schema using the enterprise pack, I can clearly reproduce
and the hotspots are again:
1. DocumentModel.updateModel()
2. DocumentModel.DocumentModelModificationTransaction.removeDE()

I can also see a lot of debug messages in the console coming from classes in
package org.netbeans.modules.editor.structure.api.
Comment 1 Petr Jiricka 2006-10-13 09:16:03 UTC
It is not clear to me what the problem is and where it is. What are the steps to
reproduce and what happens? What are the messages coming from
org.netbeans.modules.editor.structure.api? Marking as INCOMPLETE, waiting for
more input.
Comment 2 Marek Fukala 2006-10-13 10:49:52 UTC
1) please attach the messages.log or the console output with the messages from
the rg.netbeans.modules.editor.structure.api.

2) attach some threaddumps done while the 100% CPU load

3) can you please provide an exact list of steps to reproduce the problem?

Thanks.
Comment 3 Samaresh Panda 2006-10-13 23:53:10 UTC
Evn though, the schema validation passes, while building the axi model, some
schema components are null.

In this case, the base for a complex extension is null. I'll have to take care
of this situation. Ideally it shouldn't happen.

In any case I'm going to integrate a fix, but the problem remains, that is DV
shows up after the fix, but IDE is still unresponsive and CPU consumption is 100%.
Comment 4 Samaresh Panda 2006-10-14 04:16:38 UTC
Ignore my last comments. I updated the wrong issue. I'll update this one with
more info.
Comment 5 Samaresh Panda 2006-10-16 22:56:22 UTC
Here is how you can reproduce the problem:

- build enterprise pack.
  cd nbbuild/entpack
  ant soa
- run the ide
- open the attached schema (OTA)
- Click on elements, you'll see some elements to the right
- right-click on TPA_Extensions and refactor-rename to say TPA_Extensions1
- you'll see the preview window, click refactor
- refactoring will finish in few seconds but the CPU gets busy even after
refactoring is done.

check the attached thread-dump and the console log that I have. I do not have
the log file anymore.

Comment 6 Samaresh Panda 2006-10-16 22:59:26 UTC
Created attachment 35248 [details]
OTA Schema
Comment 7 Samaresh Panda 2006-10-16 23:00:23 UTC
Created attachment 35249 [details]
console messages
Comment 8 Samaresh Panda 2006-10-16 23:00:47 UTC
Created attachment 35250 [details]
thread dump
Comment 9 Marek Fukala 2007-02-16 14:41:35 UTC
Reassigning to default owner of selected subcomponent. New owners are gladly
welcomed.
Comment 10 Samaresh Panda 2007-03-31 18:04:03 UTC
This was filed by me long time back and I know you did some work. The traces
were originally coming from editor.structure.api and I do not see any updates
from you after my inputs.
Comment 11 Marek Fukala 2007-04-02 09:11:31 UTC
No, I didn't do any changes related to this issue AFAIK so the issue is still valid.
Comment 12 Marek Fukala 2007-04-20 10:52:42 UTC
Hi Samaresh, could you please check this problem now? The fixes done to issue
#89277 affects also CPU performance, not just memory consumption. Thanks.
Comment 13 Samaresh Panda 2007-04-25 20:45:07 UTC
I'm sorry, the situation is worse now. IDE remains unusable for atleast 3mins
and I had to kill it. I can clearly see a lot of output in the console, just
keeps coming....never stops.

****
= DE (28042396)["xs:schema" (tag) <250-819584> '<xs:schema...']
[DTM] removing DE (27981029)["..." (content) <713348-713348> '']
[DMT] removed element DE (27981029)["..." (content) <713348-713348> ''] ;parent
= DE (28042396)["xs:schema" (tag) <250-819584> '<xs:schema...']
[DTM] removing DE (27980464)["..." (content) <713348-713348> '']
[DMT] removed element DE (27980464)["..." (content) <713348-713348> ''] ;parent
= DE (28042396)["xs:schema" (tag) <250-819584> '<xs:schema...']
[DTM] removing DE (27974364)["..." (content) <713348-713348> '']
[DMT] removed element DE (27974364)["..." (content) <713348-713348> ''] ;parent
= DE (28042396)["xs:schema" (tag) <250-819584> '<xs:schema...']
[DTM] removing DE (27969072)["..." (content) <713348-713348> '']
[DMT] removed element DE (27969072)["..." (content) <713348-713348> ''] ;parent
= DE (28042396)["xs:schema" (tag) <250-819584> '<xs:schema...']
[DTM] removing DE (27962822)["..." (content) <713348-713348> '']
[DMT] removed element DE (27962822)["..." (content) <713348-713348> ''] ;parent
= DE (28042396)["xs:schema" (tag) <250-819584> '<xs:schema...']
[DTM] removing DE (27962205)["..." (content) <713348-713348> '']
[DMT] removed element DE (27962205)["..." (content) <713348-713348> ''] ;parent
= DE (28042396)["xs:schema" (tag) <250-819584> '<xs:schema...']
[DTM] removing DE (27960095)["..." (content) <713348-713348> '']
[DMT] removed element DE (27960095)["..." (content) <713348-713348> ''] ;parent
= DE (28042396)["xs:schema" (tag) <250-819584> '<xs:schema...']
[DTM] removing DE (27959423)["..." (content) <713348-713348> '']
[DMT] removed element DE (27959423)["..." (content) <713348-713348> ''] ;parent
= DE (28042396)["xs:schema" (tag) <250-819584> '<xs:schema...']
[DTM] removing DE (27957838)["..." (content) <713348-713348> '']
****
Comment 14 Marek Fukala 2007-04-26 09:50:08 UTC
OK, I'll try to reproduce. BTW, thanks for finding the forgotten debug message :-)
Comment 15 Marek Fukala 2007-04-27 13:47:06 UTC
I have improved the DocumentModel update a bit, the peformance save is about
300% on the sample file. 

However the biggest bottleneck in the testcase is the XML folding. The used
algorith - model fires change events - folding is synchronously updated is not
effective and if there is a big change in the document then the performance is
terrible. I'll fix this ASAP.

Checking in DocumentModel.java;
/cvs/xml/tageditorsupport/src/org/netbeans/modules/editor/structure/api/DocumentModel.java,v
 <--  DocumentModel.java
new revision: 1.37; previous revision: 1.36
done
Comment 16 Marek Fukala 2007-04-27 13:49:28 UTC
I ment that the the perf is 3 times better of course :-)
Comment 17 Samaresh Panda 2007-06-13 22:52:45 UTC
After Marek's changes this is a lot better. Marking this as fixed.