aspose file tools*
The moose likes Linux / UNIX and the fly likes High CPU usage when execute native command through java Runtime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "High CPU usage when execute native command through java Runtime" Watch "High CPU usage when execute native command through java Runtime" New topic
Author

High CPU usage when execute native command through java Runtime

Hacken Lee
Greenhorn

Joined: Jan 18, 2009
Posts: 2

Have you guys met below problem, what's you investigation?

After issued a command of "kill -9 pid" using Runtime, it is not 100% reprocuced

try {
Process process = Runtime.getRuntime().exec("/bin/kill -9 " + pid);
int value = process.waitFor();
//hang here, and CPU is high , almost 100%
...
}


configurations:

java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Server VM (build 1.6.0_03-b05, mixed mode)

SunOS 5.10 Generic_137111-08 sun4u sparc SUNW,Sun-Fire-V240
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

"gossipgirl li " please check your private messages for an important administrative matter. You can check them by clicking the My Private Messages link above.


SCJP, SCWCD.
|Asking Good Questions|
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: High CPU usage when execute native command through java Runtime