java.io.IOException: Cannot run program "videostore": java.io.IOException: error=24, Too many open files
Javadoc says:
The parent process uses these streams to feed input to and get output from the subprocess. Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock.
Secondly, waitFor()
your process to terminate. You then should close the input, output and error streams.
Finally destroy()
your Process.
Process proc=null;
try {
ProcessBuilder pb = new ProcessBuilder(params);
pb.redirectErrorStream(true);
proc = pb.start();
proc.waitFor();
} catch (Exception e) {
log.error("QtStore: ",e);
return;
}finally{
if(proc!=null) //关闭输入输出流,释放内存
proc.destroy();
}
标签:files,run,many,subprocess,pb,streams,input,output,proc From: https://blog.51cto.com/u_1923895/5939822