My Java application blocks in Runtime.exec() as these thread dump shows:
"main" prio=1 tid=0x804e360 nid=0x7ecc waiting on monitor
at java.lang.Object.wait(Native Method)
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.Runtime.execInternal(Native Method)
It does not seem to be a problem of exhausting the resources associated to
the process's streams (as some postings in the internet suggest). The
funny thing is that the execution of that exec only hangs when I am
executing it from within an application that I am trying to debug (if I
execute the exec outside that code, it works!). The only thing I see that
maybe could have an impact is that in my code I am launching several other
processes through Runtime.exec(...); however, these exec's do not block.
The goal of the exec is to execute "cat /proc/loadavg" to see the load of
the system at that point in the Java code. However, I don't think the
specific command is relevant.
Thanks in advance,
On 15 Jul 2004 13:22:14 -0700, Sergio wrote:
> The goal of the exec is to execute "cat /proc/loadavg" to see the
> load of the system at that point in the Java code. However, I don't
> think the specific command is relevant.
Why use cat? Can't you just open and read /proc/loadavg with a
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e