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 48728 - Code in ExternalCommand.OutputGrabbersProcessor.run running in background
Summary: Code in ExternalCommand.OutputGrabbersProcessor.run running in background
Status: RESOLVED WORKSFORME
Alias: None
Product: obsolete
Classification: Unclassified
Component: vcscore (show other bugs)
Version: 4.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2004-09-08 21:26 UTC by Jesse Glick
Modified: 2004-09-22 23:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump (8.04 KB, text/plain)
2004-09-20 21:12 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2004-09-08 21:26:42 UTC
I noticed in a profiler that even with NB idle
(nb_all mounted, but all projects closed, memory
toolbar off), a bunch of strings and such were
still being created.

CPU profiler for about 10 sec with the NB idle
(and not painted) shows some time in EC.OGP.run,
as well as some in
CommandProcessor.executorStarterLoop.

arch.xml for vcscore says "no" to perf-wakeup yet
the code has

if (!processed) {
    Thread.currentThread().sleep(200);
}

in an infinite loop, which certainly looks like a
busy loop.
Comment 1 Martin Entlicher 2004-09-19 20:59:17 UTC
This is a busy loop, but only while a command is running. The cycle in
EC.OGP.run() should stay waiting at "outputGrabbers.wait();" when no
command is running. The same is true for
CommandProcessor.executorStarterLoop():
...
try {
    wait();
} catch (InterruptedException intrexc) {
...
this wait() will block the thread until someone schedule a command for
execution, which resurrects the loop.

Jesse, can you please attach a thread dump when NB is idle? If these
threads are active then there must be some command(s) running for some
reason...
Comment 2 Jesse Glick 2004-09-20 21:12:28 UTC
As I said, the profiler stuff I noticed *was* with NB idle.

Attaching a thread dump from 040920 custom, with the IDE idle. I did
one simple CVS operation in the IDE first - refreshed status on a
small dir with no subdirs - to make sure everything was "warmed up".
Comment 3 Jesse Glick 2004-09-20 21:12:52 UTC
Created attachment 17773 [details]
Thread dump
Comment 4 Martin Entlicher 2004-09-21 13:57:56 UTC
Thanks. The thread dump looks O.K., all threads are waiting at
Object.wait(). No sleep in a busy loop. The same is true for my tests.

If the profiler reports some activity, it would be good to have a
thread dump when such an activity is in place so that we can track
where it comes from and what's really happening in there.

So far this works for me, I can not reproduce any running threads
while NB is idle, the threads are always waiting at Object.wait() in
thread dumps.
Comment 5 Martin Entlicher 2004-09-22 18:33:20 UTC
It simply works for me. Even after I execute many commands, when the
IDE is idle, all threads ends at Object.wait().
Comment 6 Jesse Glick 2004-09-22 18:37:19 UTC
I opened this based not on thread dumps, but on profiler output which
showed activity in this part of the code while the IDE was idle. If I
get a chance I will try to reproduce again, but I think I have too
many other things to do at the moment.
Comment 7 Martin Entlicher 2004-09-22 19:18:45 UTC
O.K., I've run it in OptimizeIt. I've minimized the IDE and run CPU
profiler. It really reported 40 ms in
CommandProcessor.executorStarterLoop() and 470 ms in some anonymous
RequestProcessor.

But after that when I run the CPU profiler again for ~200 seconds, the
only two active threads it reported were Signal Dispatcher and
AWT-Motif. There was absolutely no activity in
CommandProcessor.executorStarterLoop() any more.

Thus it looks like the first measurement catched some relict of the
previous activity...
Comment 8 Jesse Glick 2004-09-22 23:45:13 UTC
Huh, could just be a profiler artifact then. Thanks for checking.