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 90482 - CPU at 100%, allocating heap memory constantly
Summary: CPU at 100%, allocating heap memory constantly
Status: RESOLVED DUPLICATE of bug 107029
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2006-12-02 18:06 UTC by _ gsporar
Modified: 2007-10-24 06:48 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
thread dump (13.42 KB, text/plain)
2006-12-02 18:07 UTC, _ gsporar
Details
message log file (708.80 KB, text/plain)
2006-12-02 18:08 UTC, _ gsporar
Details
second thread dump (17.30 KB, text/plain)
2006-12-02 18:35 UTC, _ gsporar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gsporar 2006-12-02 18:06:47 UTC
NB 5.5 FCS with Profiler 5.5 FCS, Ent Pack 5.5 FCS, Mobility 5.5 FCS, VWP 5.5
Technical Preview, and C/C++ 5.5 Beta3 installed.  Running on WinXP, using JDK5u9.

Every once in a while, the IDE starts allocating heap space like crazy and pegs
the CPU at 100%.  I can watch the memory graph in the toolbar climb by up to as
much as 20mb at a time until it gets close to 512mb (which is what I have set
for Xmx).  Then apparently a full GC is done and the amount of heap in use drops
all the way to about 50mb.  So, at least there's no memory leak.  :-)

Unfortunately, within less than a minute heap usage climbs back up again to
almost 512mb.  Then another GC pause.  Then it starts all over again.

It appears to be doing this on a background thread because the user interface of
the IDE remains responsive, but is *very* sluggish.  To the point of almost
being unusable.

Unfortunately, I do not have a pattern of usage that can consistently reproduce
this.  I do have a thread dump which I will attach.  

Two things to note:

1. I frequently delete projects, and I always check the "remove source under the
directory" option.  On the most recent occurence of this problem, the last thing
of any significance that I had done was to delete a project.  Unfortunately, I
don't recall the exact amount of time between deleting the project and the
runaway memory/CPU usage.  The message log is attached.  Looks like during the
delete of the project's files the IDE is unhappy because it cannot find some
files (the project was a simple web application, deployed to GlassFish).  But
because I am uncertain of the exact timing, I don't know for certain if those
messages were being written while the CPU was at 100%.

2. Pressing Ctrl-Break over in the console window in order to get the thread
dump caused everything to go back to normal.  No more 100% CPU utilization.  And
the heap is back at 50mb.  :-)
Comment 1 _ gsporar 2006-12-02 18:07:16 UTC
Created attachment 36437 [details]
thread dump
Comment 2 _ gsporar 2006-12-02 18:08:22 UTC
Created attachment 36438 [details]
message log file
Comment 3 _ gsporar 2006-12-02 18:34:57 UTC
I was able to get this to happen again by doing the following:

1. Create a simple web application.  I used the J2EE 1.4 Sample "Client side
state" blueprint.

2. Run the application.

3. Add a web service client to it.  I used
http://ws.cdyne.com/delayedstockquote/delayedstockquote.asmx?wsdl

4. Delete the web service client.  (there are some problems with this, but I'll
save those for a different IZ :-) )

5. Over in the runtime pane, disable the application and then undeploy it.

6. Delete the project.  Choose the "delete files under project" option.

7. In the Windows Explorer, delete the project's directory and everything under it.

8. CPU goes to 100%, IDE allocates heap memory constantly.  Oh, and I should
have mentioned before: something is hitting the disk pretty hard too.  This time
I verified that the messages.log file is *not* growing during the 100% CPU/heap
usage.

New thread dump attached.

As before, using Ctrl-Break to request the thread dump stopped the behavior.

Comment 4 _ gsporar 2006-12-02 18:35:33 UTC
Created attachment 36439 [details]
second thread dump
Comment 5 Jiri Kovalsky 2006-12-05 15:20:21 UTC
Reassigning to 'openide' module for further evaluation.
Comment 6 Jiri Kovalsky 2006-12-05 15:20:56 UTC
Changing subcomponent accordingly.
Comment 7 rmatous 2007-01-11 10:34:08 UTC
Projects->delete - reassigned 
Comment 8 Milos Kleint 2007-01-19 10:53:07 UTC
> 6. Delete the project.  Choose the "delete files under project" option.
> 7. In the Windows Explorer, delete the project's directory and everything
under it.

Now there's something strange. You delete the project in the IDE *AND* on the
command line at the same time?
the ide in 6. should do that for you. is it too slow or anything that you decide
to override that by going to the command line as well?

I doubt such situation can be handled gracefully by the IDE. Either leave that
up to the IDE or delete externally (there's probably some issues with external
deletion, but these are to be fixed) but I doubt we can handle the scenario when
you do both at the same time.

do you get the same behaviour with standard j2se project or is it webapp specific?
Comment 9 _ gsporar 2007-01-19 15:59:58 UTC
>You delete the project in the IDE *AND* on the command line at the same time?

No, not at the same time.  I should have been more clear in my description of
the steps.  I delete the project from within the IDE and I wait until after the
IDE closes the delete dialog box.  Then I go look at the directory using the
Windows Explorer.  

>the ide in 6. should do that for you. is it too slow or anything that you
decide to override that by going to the command line as well?

It's not the speed that is the problem.  The reason I go look at it with the
Windows Explorer is to verify that the project directory really got deleted. 
And it does not get deleted.  Some of the files/directories under it are gone,
but the /components and /lib subdirectories are still there.  So I use the
Windows Explorer to delete the project directory and everything it contains.

>I doubt such situation can be handled gracefully by the IDE.

Agreed, but I am not trying to do both deletes at the same time.  I give the IDE
an opportunity to delete the directory and all its contents.  After it fails to
do the job completely, I go in and finish the job.  :-)

>do you get the same behaviour with standard j2se project or is it webapp specific?

I tried four times just now with creating the GUI Form Examples J2SE
application. I only got the problem to reproduce one time so there is more
involved here than I understand.  :-(  In this situation, the project directory
has only one subdirectory in it: lib which has complibs in it.  The fact that
complibs exists in a J2SE project is, I believe, the result of a bug in the
initial version of the Technical Preview of VWP 5.5.
Comment 10 Milos Kleint 2007-10-24 06:48:36 UTC
it seems that the issue with not deleted content is related to/duplicate of #107029 and also #118228.

The only thing that is happening in the thread dumps seems to be related to the filesystem refresh task that is
triggered when one switches from other apps to netbeans.

marking as duplicate of #107029

*** This issue has been marked as a duplicate of 107029 ***