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.
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.
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.
Created attachment 53330 [details] StackTrace
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?
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.
Marek, you might have seen something similar...
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!
Created attachment 54607 [details] Thread Dump
Created attachment 54608 [details] Thread Dump
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.
Sorry, just saw the subject referred to RC1. The problem perists in the released version (current version). Thank you for looking into this.
highlights are doing a lot of work there, it seems. CCing Jan and Mila
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?
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.
Created attachment 54639 [details] Created new project thread dump
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.
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.
Created attachment 54839 [details] New ThreadDump
Created attachment 54840 [details] New Thread Dump 2
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.
CCing Vita, as the thread dumps mostly refer to the generic editor part of the highlighting.
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
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?
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.
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!
Vague virtually unreproducible issue is not P1 ... Making it back to P3.
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?
Try self profiling: http://wiki.netbeans.org/FitnessViaPartnership
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.
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.
Created attachment 104674 [details] Profiler snapshot 2, normal NetBeans operation
Created attachment 104675 [details] Screenshot, stuck saving snapshot
Created attachment 104676 [details] Screenshot, attributes.xml error
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.
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.
Created attachment 105569 [details] Profiler snapshot of slow NetBeans
Created attachment 105570 [details] Profiler snapshot of slow NetBeans
Created attachment 105571 [details] Profiler snapshot of slow NetBeans
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.
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.
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.
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.