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 122510 - NB 6.0 Extremely Slow Performance
Summary: NB 6.0 Extremely Slow Performance
Status: RESOLVED WORKSFORME
Alias: None
Product: ide
Classification: Unclassified
Component: Performance (show other bugs)
Version: 3.x
Hardware: PC Windows XP
: P3 blocker with 3 votes (vote)
Assignee: issues@performance
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2007-11-21 14:29 UTC by shannonbrown
Modified: 2012-06-08 09:30 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
StackTrace (13.08 KB, text/plain)
2007-11-21 18:48 UTC, shannonbrown
Details
Thread Dump (14.30 KB, text/plain)
2008-01-02 16:07 UTC, shannonbrown
Details
Thread Dump (14.24 KB, text/plain)
2008-01-02 16:07 UTC, shannonbrown
Details
Created new project thread dump (12.94 KB, text/plain)
2008-01-03 13:49 UTC, shannonbrown
Details
New ThreadDump (14.12 KB, text/plain)
2008-01-08 21:39 UTC, shannonbrown
Details
New Thread Dump 2 (14.23 KB, text/plain)
2008-01-08 21:39 UTC, shannonbrown
Details
Profiler snapshot 1, normal NetBeans operation (7.69 KB, application/octet-stream)
2011-01-03 22:40 UTC, mikato
Details
Profiler snapshot 2, normal NetBeans operation (3.97 KB, application/octet-stream)
2011-01-03 22:41 UTC, mikato
Details
Screenshot, stuck saving snapshot (125.84 KB, image/png)
2011-01-03 22:41 UTC, mikato
Details
Screenshot, attributes.xml error (21.25 KB, image/png)
2011-01-03 22:42 UTC, mikato
Details
Profiler snapshot of slow NetBeans (44.08 KB, application/octet-stream)
2011-02-01 20:30 UTC, mikato
Details
Profiler snapshot of slow NetBeans (27.02 KB, application/octet-stream)
2011-02-01 20:31 UTC, mikato
Details
Profiler snapshot of slow NetBeans (12.12 KB, application/octet-stream)
2011-02-01 20:31 UTC, mikato
Details
Profiler snapshot of slow NetBeans (46.46 KB, application/octet-stream)
2011-02-01 20:31 UTC, mikato
Details
Profiler snapshot of slow NetBeans, different system & project (6.03 KB, application/octet-stream)
2011-02-16 18:49 UTC, mikato
Details

Note You need to log in before you can comment on or make changes to this bug.
Description shannonbrown 2007-11-21 14:29:49 UTC
System:
Windows XP SP2 (all current patches)
Physical system memory: 1GB
Processor: AMD Turion Dual Processor 1.8

NetBeans Version: Netbeans 6.0 RC1
Java: 1.6_03

Problem:
I have run NetBeans versions for about a year. With 6.0 RC1 doing web (JSP, etc.) development, the IDE performance 
makes the IDE essentially unusable. Any IDE editing causes significant delays in what appears to be parsing issues. 
This can be 10 to 30 seconds or more PER edit. In that time, all contact with the IDE ceases--it appears to hang.
Comment 1 Marian Mirilovic 2007-11-21 15:38:33 UTC
Hi Shannon, 
could you please generate thread-dump during the freeze :
http://wiki.netbeans.org/wiki/view/GenerateThreadDump
... and attach the file into this issue ? Thanks in advance.
Comment 2 shannonbrown 2007-11-21 18:48:44 UTC
Created attachment 53330 [details]
StackTrace
Comment 3 Petr Nejedly 2007-11-22 13:56:28 UTC
In the thread you posted, the JVM is idle and you weren't short on memory either.
Have you generated the thread dump during the freeze?
Comment 4 shannonbrown 2007-11-26 14:26:56 UTC
I did more work with this issue. The stack trace attached is the best I can do.

I have noted that the issue arises when editing 'longer' JSP pages. By longer, I mean approximately 500 lines of code 
or longer. The 'freezes' can be quite long--20-30 seconds--per edit. So, if I edit 

theobject.setValue("something") ;

to

theobject.setValue("somethingelse") ;

with each new character in 'else' the IDE kerchunks kerchunks kerchunks. It makes editing very difficult. I open the 
same file in NB 5.5 and there is no issue. (I believe the parser changed between the two NB versions and this may be 
an issue related to the change.) 

I have also turned off all unused modules to try to free more memory.
Comment 5 Petr Nejedly 2007-11-26 14:41:45 UTC
Marek, you might have seen something similar...
Comment 6 Marek Fukala 2007-11-26 15:31:16 UTC
Can you please attach the file on which you can reproduce the problem? Does the problem happen if you edit pure html/jsp
or just in embedded java code inside? 

I have similar issue #122376 which may be related. 

It would really help if you try produce another threaddump/s during the high CPU load. 

Thanks in advance!
Comment 7 shannonbrown 2008-01-02 16:07:00 UTC
Created attachment 54607 [details]
Thread Dump
Comment 8 shannonbrown 2008-01-02 16:07:52 UTC
Created attachment 54608 [details]
Thread Dump
Comment 9 shannonbrown 2008-01-02 16:12:04 UTC
Good morning,

Finally getting some good thread dumps.

The issue persists. Generally, the files edited are JSP files and are fairly lengthy--approximately 500 lines of code 
or more. I am not sure if you can tell from the thread dump, but the delays-lockups are lengthy--60 seconds or more. 
Wiondows reports CPU usage for the java.exe of approximately 50% during these lockups.

The issue is not just an annoyance. These 'delays-lockups' occur essentially for EVERY edit. So, for example, I take 
line 250 and add a simple change from String s = "" ; to StringBuffer sb = new StringBuffer() ; This change can take 
several minutes (I am not exaggerating) as the delay-lockup occurs after each character input.

Comment 10 shannonbrown 2008-01-02 16:16:31 UTC
Sorry, just saw the subject referred to RC1. The problem perists in the released version (current version).

Thank you for looking into this.
Comment 11 Petr Nejedly 2008-01-03 11:13:13 UTC
highlights are doing a lot of work there, it seems. CCing Jan and Mila
Comment 12 Marek Fukala 2008-01-03 12:29:18 UTC
Can you please try to create a new web project from template and put one of the longer jsps there and try to edit it? If
the delays are still the same as in your project, could you attach the file?
Comment 13 shannonbrown 2008-01-03 13:47:47 UTC
Thank you.

I followed your request. This may be lengthy but helpful.

1- I created a new, clean, web project.
2- I copied one of the lengthy files from the old project into the new project BUT copied it to the web pages root 
(not original location). Call this file A.jsp.
3- I copied the /resources directory from the old project to the new project. This directory consists of an include 
file with basic overall parameters used by each page and is required. 
Example: <%@include file="../resources/resources.jsp" %>

OK. At this point, I open A.jsp and try to edit. No apparent problems. Edits seem to be fine. Slight delays but not 
abnormal--and really not enough to switch and get a thread dump.

NOTE: I did note one possible change in the editor-file and a change that does create some kerchunking. This will take 
some time to describe, and I apologize if I do not use correct terms.

In the above new file, it did not seem like there was any significant delay on the face. BUT, the application uses a 
number of beans. When I copied the code from Source Packages in the old project to Source Packages in the new project, 
I did see a change aand did start to see some kerchunking.

The application uses several basic includes in each JSP page. One of the include files defines simple variables used 
regularly throughout the application (described above). Let's call this resources.jsp. 

There is another file regularly included that defines the session beans (there are multiple beans). 
Example: <jsp:useBean id="webuser" scope="session" class="com.yyy.web.UserBean"></jsp:useBean>
Let's call this sessionbeans.jsp.
Page A.JSP (described above) includes resources.jsp and sessionbeans.jsp. This creates a consistent set of resources 
available to each page.

A little history. In NetBeans 5.5, these types of includes in JSP were not a problem (and should not be a problem). 
However, the earlier versions of NetBeans 6.0 did not handle includes on JSP pages at all. These resources simply were 
not included in the editor which showed errors for any reference. This issue was worked on and did seem to be 'fixed' 
in that the included file resopurces were available in the editor. 
Example: If I declared a variable int TESTMODE = 2 
in resources.jsp and included resources.jsp in A.jsp, then I could reference TESTMODE in A.jsp--
Example: if (TESTMODE==2) ...
The fix to the include problem in the earlier version of 6.0 and really up until just before the final version did 
seem to make these resources available.

OK, after I copy the source code from the old project to the new project, I see the same error. I also started to see 
some kerchunking--not as bad but noticable. (I attached a new threaddump -- #003)

NOW, why did I go into all this history? One issue that persisted, even after the 'include fix,' involved including 
the sessionbeans.jsp file (described above). The editor still showed a red error on this line. The error states in 
part (it repeats for EVERY included bean: webuser already defined in in SimplifiedJSPServlet qqqbean already defined 
in SimplifiedJSP Servlet .... This error returned after copying the source from the old to new project. The new 
project is probably now parsing these files as well??????

I am not sure if this is relevant, but I thought I would note all issues. I don't want to bias your analysis. The 
issue may be unrelated.
 





  

Comment 14 shannonbrown 2008-01-03 13:49:14 UTC
Created attachment 54639 [details]
Created new project thread dump
Comment 15 Marek Fukala 2008-01-03 15:01:06 UTC
Thanks for the comments, just one more little question - does A.jsp contain many java code - references to other
classes? And does it staticaly include many other jsps? After you copied the source files to the new project is editing
of *any* jsp slower? It looks like the primary cause of the cpu load is the virtual java source model for the jsp page
or some feature operating on it. Unfortunatelly the latest threaddump shows no activity, the ide was idle.
Comment 16 shannonbrown 2008-01-03 16:03:14 UTC
I will try to answer your followups as best aas I can.

A.jsp 'includes'
The A.jsp file IMPORTS a number of packages per the:
<%@page import="several packages listed" ....

Then the A.jsp INCLUDES three .jsp files:
<%@include file="../resources/resources.jsp" %> ----- a simple list of common attributes, no real code
<%@include file="../resources/authen.jsp" %> ------ a simple authentication module 
<%@include file="../resources/sessionobjects.jsp" %> ----- defines the session level objects

These are the only includes. This is a standard 'header' in all of the application JSP files--long and short files.

Static Includes
I am not sure what this means. Hopeefully, the above examples answer your question. They are exact code.

Source Slower in IDE
Generally, yes. After copying the source files the error I described before appeared (regarding duplicates), and there 
was some slow down of the IDE. However, the slow down was not as pronounced as before. Note, however, that the 'new' 
web project does not have all the libraries, etc. loaded.

Note: I am not at that computer right now and cannot test more immediately.


Comment 17 shannonbrown 2008-01-08 21:39:35 UTC
Created attachment 54839 [details]
New ThreadDump
Comment 18 shannonbrown 2008-01-08 21:39:57 UTC
Created attachment 54840 [details]
New Thread Dump 2
Comment 19 shannonbrown 2008-01-08 21:43:25 UTC
Good afternoon,

Spent most of the day in NetBeans.

I have noted that the issue is peculiar. First, it always happens. That is, it is not generally intermittant.
Second, the kerchunking may occur with much smaller files than initially reported. The one file is approximately 750 
lines in total--including comments, HTML, etc.

The kerchunking seems to occur with each change in the editor. I saw this a lot today. You make a change and the 
editor seems to hand for a while, then seems to refresh itself--reporting any errors, etc.

-S

I did attach two new thread dumps. I am not sure if they are helpful to you for further diagnosis. 
Comment 20 Jan Lahoda 2008-01-08 23:28:26 UTC
CCing Vita, as the thread dumps mostly refer to the generic editor part of the highlighting.
Comment 21 Vitezslav Stejskal 2008-01-09 10:11:40 UTC
Umm, not sure, the code you see runs when a part of JTextComponent needs repainting. There is probably not much bad in
this code itself, but we should find out what and why keeps asking the component to repaint.

Is the problem generally reproducible? I mean, have we tried (starting with fresh trunk build) to emulate what Shannon
is doing and observed the same kerchunking? If so, could somebody post the steps here please? Thanks
Comment 22 Marek Fukala 2008-02-26 09:20:07 UTC
Reassigning to Vita based on the latest findings. BTW the JSP editor has been modified significantly recently by the new
GSF based editing support. Tomas Mysik also did some great performance improvements into the JSP parser. Reporter, can
you please check if the problems persists on the latest daily 6.1 builds?
Comment 23 Vitezslav Stejskal 2008-02-26 15:01:20 UTC
I'm sorry, but I'm not able to actively work on this. If somebody finds out what the problem is and that it is in the
editor infra we will think about possible solutions. But I'm not able to do any research/profiling/etc.
Comment 24 ayermolayev 2009-09-04 19:37:38 UTC
This should a highest priority issue!
NB6.7 gets worse in performance than the predecessor and the trend continues since 5.5!
It will just stop working some time with one of the next releases!
Comment 25 David Strupl 2009-09-22 12:06:18 UTC
Vague virtually unreproducible issue is not P1 ... Making it back to P3.
Comment 26 mikato 2010-12-20 17:56:01 UTC
I seem to have the same problem as Shannon, glad I found this bug.  It's so strange since I recently built a really fast computer (Core i7-950 3.06GHz, 8GB memory, SSD!) and started using NetBeans and it's the first thing I've noticed that was slow in any way. This problem is slowing NetBeans down to a crawl.  Once this slowdown starts to occur, NetBeans is basically unusable.  It takes a minute to do one keystroke, undo/redo, and scrolling or dragging across multiple lines is really difficult.  I notice javaw.exe is using up to 16% CPU during this (as I do nothing) and about 700Mb of memory.  It also sometimes says "Checking for external changes" at the bottom with a progress bar that doesn't move (I see FIXED bug http://netbeans.org/bugzilla/show_bug.cgi?id=183201 with that message but don't know if related).  Thankfully it doesn't crash and I can still wait a long time and then save if needed, but it's obviously killing productivity.

Like Shannon, this occurs on larger JSPs, ~800 lines, with a bunch of Java and HTML in them.  They are part of a pretty big project.  For one JSP, three classes are included.  I first noticed it when I was going through and retabbing one of these JSPs, but now it seemingly occurs no matter what action I'm doing.  Closing and restarting NetBeans doesn't seem to help that much.  Sometimes when I close I get a message - Exit IDE .. Exiting the IDe will terminate the following processes: Checking for external changes, Scanning projects.  I wait and it eventually closes by itself.  I noticed those two items appearing and disappearing in the list a few times before it closed if that helps.

I have 6.9.1.
Let me know how I can help you diagnose.  It's a major problem.  Should I try thread dumps?
Comment 27 Jaroslav Tulach 2010-12-20 19:29:33 UTC
Try self profiling:
http://wiki.netbeans.org/FitnessViaPartnership
Comment 28 mikato 2010-12-28 22:35:18 UTC
Well I haven't been able to profile this working with the same code yet, but I have had this slowdown occur very similarly with a 2000 line PHP file.  It's mostly HTML.  I was find/replacing and deleting some inline css from many spots when the problem started.  It's not part of my main project so I guess I can't profile it.  It has the "Checking for external changes" bar running across the bottom every once in a while (for >10 seconds) and everything from scrolling to clicking the cursor into a new spot slows down pretty badly.

Does everyone else just have all smaller files or what?  The only thing I have non-stock is the WordCount plugin and I don't think that runs unless you tell it to.  If I come across a file that I could give up for an example I'll put it here.

By the way the instructions for profiling at the link you gave are quite a bit different from what I saw in NetBeans so maybe it's out of date.
Comment 29 mikato 2011-01-03 22:40:39 UTC
Created attachment 104673 [details]
Profiler snapshot 1, normal NetBeans operation

I got a major slowdown in another JSP today and I thought I was able to do one snapshot, but I could not find it where I saved it or anywhere afterward. On the second snapshot I was taking the darn thing froze at 93% "saving snapshot".  I had to wait to see if it actually saved before closing 

down NetBeans.  javaw.exe was 13% CPU in task manager this whole time.  Then NetBeans started flashing in and out.  When I say that I mean NetBeans disappeared 

showing the desktop and then reappeared quickly.  After a few moments it would do it again.  I've had this happen once before as well.  I had to kill it then.  Minutes pass and it's at 94% and no longer flashing.  Maybe it will work :)  I closed a tab I had open for Threads in Profiling and it gave me an error: "Cannot rename file attributes.xml~ in C:\Users\Michael\.netbeans\6.9\var to attributes.xml.  I also had this happen in my previous situation.  Ah it lets me edit once again.  I start closing tabs after I check what I had open until all were closed.  More waiting, so I take screenshot.  I watched the memory continue to fluctuate from ~340/451.9MB to 420/451.9MB.  Then it finally dropped to ~315/423.2MB.  I checked the CPU usage again and it was 0.  Memory usage kept changing though, slowly increasing.  I finally just closed NetBeans since it was usable and it cancelled the snapshot.  Then I looked for the first snapshot and it wasn't to be found.

I opened NetBeans again and the files open were all the old set, showing lots of file tabs open when I had closed them all before, plus the weren't even the last ones I had open.  I tried again and was able to save two snapshots but NetBeans was operating normally at the time.  I don't know if they will be helpful. I will attempt again during the next slowdown.
Comment 30 mikato 2011-01-03 22:41:16 UTC
Created attachment 104674 [details]
Profiler snapshot 2, normal NetBeans operation
Comment 31 mikato 2011-01-03 22:41:43 UTC
Created attachment 104675 [details]
Screenshot, stuck saving snapshot
Comment 32 mikato 2011-01-03 22:42:10 UTC
Created attachment 104676 [details]
Screenshot, attributes.xml error
Comment 33 Jaroslav Tulach 2011-01-04 09:46:27 UTC
None of the last two nps files shows anything significant. Definitely nothing related to JSP editing. One of the snapshot shows background check of sources time stamps and we are working on eliminating this for 7.0.

We have seen the attributes.xml error reports before, but we still don't know why they happen (is the file on disk or not?).

This is all that comes to my mind right now.
Comment 34 mikato 2011-01-04 17:01:55 UTC
Yes, the file attributes.xml is definitely at that location on disk.
Ok, I will try to cause another slowdown and get a better snapshot.
Comment 35 mikato 2011-02-01 20:30:31 UTC
Created attachment 105569 [details]
Profiler snapshot of slow NetBeans
Comment 36 mikato 2011-02-01 20:31:07 UTC
Created attachment 105570 [details]
Profiler snapshot of slow NetBeans
Comment 37 mikato 2011-02-01 20:31:22 UTC
Created attachment 105571 [details]
Profiler snapshot of slow NetBeans
Comment 38 mikato 2011-02-01 20:31:48 UTC
Created attachment 105572 [details]
Profiler snapshot of slow NetBeans

Ok, I believe I have some good snapshots for you!!!  See attachments 2011-02-01...
It wasn't to the point where I had to wait minutes this time but probably would have gotten there had I continued using it.
Comment 39 mikato 2011-02-16 18:49:26 UTC
Created attachment 106086 [details]
Profiler snapshot of slow NetBeans, different system & project

I'm reopening this in case nobody saw my good new snapshots from 2011-02-01.  I've also had this problem occur on my home computer on a different project and I've just attached that snapshot today as well, 2011-02-14.
Comment 40 mikato 2011-06-02 20:45:24 UTC
New development - 
I got a major slowdown several times as happens occasionally and restarted NetBeans while working on a particular JSP.  But then I actually got a popup Warning box that said "JSP cannot be parsed now"!  I also saw on the bottom status bar on the left some error with GC and out of memory.  Unfortunately it disappeared before I could record the exact message for that.  NetBeans was extremely slow to respond.  The Warning popup continued to popup over and over making new ones on top of the old.  I was able to click OK on them and they'd go away temporarily.  Then it ended up freezing (though the title bar kept on flashing in like it was going in and out of focus).  I attempted to save with no luck and I let it go for about 10 minutes before killing it.

I checked Google and searched for bugs and I don't see the "JSP cannot be parsed now" phrase anywhere.  Maybe this could help?  Is there anything I can do (besides switching IDEs)?  This is really annoying the heck out of me.  Maybe I could send this JSP if that would help but I wouldn't be able to send all the related code.
Comment 41 Marian Mirilovic 2012-06-08 09:30:01 UTC
Too old bug without any additional information. Please file new report if you will face similar problems in newer versions of the IDE. Thanks in advance.