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 178162 - Hung background process
Summary: Hung background process
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-04 10:56 UTC by quill49
Modified: 2010-04-01 23:56 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log with -J-Dorg.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.level=FINE (89.29 KB, text/plain)
2009-12-09 10:31 UTC, quill49
Details
log after starting from console (197.82 KB, text/plain)
2009-12-09 10:49 UTC, quill49
Details
startup thread dump (24.90 KB, text/plain)
2009-12-09 11:42 UTC, quill49
Details
dump at 50 (14.26 KB, text/plain)
2009-12-09 11:44 UTC, quill49
Details
messages on restart (351.69 KB, text/plain)
2009-12-09 11:45 UTC, quill49
Details
dump restart (21.78 KB, text/plain)
2009-12-09 11:45 UTC, quill49
Details
dump after copying three files (37.87 KB, text/plain)
2009-12-09 12:07 UTC, quill49
Details
dump 5 minutes after copy (27.41 KB, text/plain)
2009-12-09 12:08 UTC, quill49
Details
dump after delete (21.15 KB, text/plain)
2009-12-09 13:14 UTC, quill49
Details
copy of three files after deletion (26.70 KB, text/plain)
2009-12-09 13:24 UTC, quill49
Details

Note You need to log in before you can comment on or make changes to this bug.
Description quill49 2009-12-04 10:56:06 UTC
Task manager shows Netbeans 50% CPU usage, hard drive activity, extemely slow/stopped IDE.  Wait half hour, no change.  Normal exit of IDE.  Task manager shows Netbeans process 50% CPU, wait 15 minutes no change, hard drive activity slows file manager, etc.  Kill Netbeans process.  Restart IDE, everything normal for some work time, then repeat of above.  This has happened several times.

There is something unusual in what I am doing that might have something to do with this issue.  I have a code generator that writes 2000 plus java files.  These files are written into the code source for several IDE projects.  Commonly, the files are extenally deleted and rewritten or just overrwritten.  This causes frequent classpath and project scanning which takes some time.  Rebuilds of the rewritten source are done frequently.  A few days ago, I switched from 6.7 to the 6.8RC.  6.7 did the frequent project scanning but never the exteme CPU usage and hard drive activity.  Immediate problem in 6.8.

If this issue is of importance, I will provide whatever assistance I am able to provide, but I do not know much about what logs to provide, etc.
Comment 1 quill49 2009-12-05 10:14:57 UTC
I had this background thread begin again.  When I did a run on the project that generates the java code, the progress bar showed run, but it did not complete for several minutes.  I tried exit IDE, a message appear; Exiting the IDE will terminate these processes:  Generator (run)

periodically added and removed to the above was
scanning projects ...  (I believe but not certain, I did not time a screen shot at the right time)

The run must have completed while the above message box was displayed and the IDE exited.

In the task manager,  Netbeans showed 50% CPU usage for 25 minutes but the process finally exited.  It appears that during this time there is extreme disk access which slows file manager.  Also, during that time the System Idle thread goes up to %50 CPU usage periodically, basically pegging the total CPU usage.

I have not determined what causes the background process to begin.
Comment 2 Peter Pis 2009-12-07 02:12:28 UTC
To reporter: could you please take thread dump while encountering the issue?

http://wiki.netbeans.org/GenerateThreadDump

Reassigning to java.
Comment 3 Tomas Zezula 2009-12-07 03:52:32 UTC
Please submit 2 or more thread dumps as described in the link attached by Peter.
Comment 4 Vitezslav Stejskal 2009-12-07 09:55:44 UTC
Also please start the IDE with -J-Dorg.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.level=FINE and attach here the log file (ie. <ide-userdir>/var/log/messages.log). Thanks
Comment 5 Vitezslav Stejskal 2009-12-07 09:56:26 UTC
What project types are you using - freeform, ordinary j2se, web, ...?
Comment 6 quill49 2009-12-09 10:31:03 UTC
Created attachment 92350 [details]
log with -J-Dorg.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.level=FINE
Comment 7 quill49 2009-12-09 10:49:02 UTC
Created attachment 92352 [details]
log after starting from console
Comment 8 quill49 2009-12-09 11:42:24 UTC
Created attachment 92354 [details]
startup thread dump

see comment
Comment 9 quill49 2009-12-09 11:43:07 UTC
I am attaching thread dumps and log.  By deleting generated source files from the file manager, a background thread starts immediately scaling from a few percent of CPU usage to 50% in about 10 seconds (task manager).  DumpStartup is before I have done anything.  DumpBackground50 after the file deletion and the CPU usage to 50%.  I then shutdown the IDE and netbeans was no longer shown in task manager (not the behaviour previously reported).  I then restarted the IDE (messagesRestart).  Without doing anything in the IDE, the CPU usage went to 50% (dumpBackgroundRestart).  I shutdown and netbeans was not shown in task manager.  I will soon let IDE run and see how long the background activity persists.
Comment 10 quill49 2009-12-09 11:44:31 UTC
Created attachment 92355 [details]
dump at 50
Comment 11 quill49 2009-12-09 11:45:07 UTC
Created attachment 92356 [details]
messages on restart
Comment 12 quill49 2009-12-09 11:45:35 UTC
Created attachment 92357 [details]
dump restart
Comment 13 quill49 2009-12-09 12:05:54 UTC
I tried another method of getting the "background thread" started which I think represents better the problem.  I copied three of the generated files to a source directory of another ejb project (separate source location, generated/src).  I copy some or all the 2000 generated files there occasionally.  I had previously deleted all so there were just the three copied files.  That started this background 50%CPU usage immediately (dumpBackgroundCopyFiles.txt).  I let that run for about five minutes with no change in 50 % activity (dumpBackgroundCopyFiles5Min.txt).  Its been running about 10 minutes now.  I will try a IDE shutdown and another thread dump.
Comment 14 quill49 2009-12-09 12:07:30 UTC
Created attachment 92358 [details]
dump after copying three files
Comment 15 quill49 2009-12-09 12:08:06 UTC
Created attachment 92359 [details]
dump 5 minutes after copy
Comment 16 quill49 2009-12-09 12:11:48 UTC
After IDE shutdown, the activity stopped altogether and there was no thread dump, no process shown in task manager.  I will try again later to reproduce the previous behaviour which was originally reported (the background thread continues after IDE shutdown).
Comment 17 quill49 2009-12-09 13:13:34 UTC
I deleted the three files (copy and deletion were done in the IDE not file manager).  The task manager immediately showed 50% CPU usage and it stayed there for 5 minutes (dumpBackgroundDeletFiles.txt), but I left and return 50 minutes later at which time there was no activity.
Comment 18 quill49 2009-12-09 13:14:16 UTC
Created attachment 92361 [details]
dump after delete
Comment 19 quill49 2009-12-09 13:23:31 UTC
I tried another copy of the three files, the 50% CPU usage started, I waited 5 minutes then exited the IDE normally.  The task manager showed no netbeans process.  I cannot seem to reproduce that scenerio.
Comment 20 quill49 2009-12-09 13:24:21 UTC
Created attachment 92363 [details]
copy of three files after deletion
Comment 21 Tomas Zezula 2009-12-10 03:28:51 UTC
From the thread dumps there are several j2ee support threads.
Reopening as user added the required info. Thanks very mach for dumps
Comment 22 Tomas Zezula 2010-03-26 15:05:02 UTC
I've filled an issue related to the concurrent j2ee refresh,, #182907.
The rest of the issue seems as a duplicate of #134990.
Can you try it in some newer 6.9 build (6.9m1 should be enough). We added some improvements in event handling, so it may be better. If not, please attach more thread dumps. If possible generate 3 successive thread dumps with approximately 5 second pauses.
Thanks
Comment 23 quill49 2010-04-01 23:56:25 UTC
Could not reproduce in 6.9M1 Build 201002152000.  Although I could get the 50% usage, the usage would go to 0 in less than a half minute (scanning projects).
Fixed.