■
Runtime#exec()使ったときに、Process#destroy()呼ぶのって、MUSTみたい。
ProcessのJavaDocより
The subprocess is not killed when there are no more references to the Process object,
but rather the subprocess continues executing asynchronously.
今日まで、実行が終われば、勝手に終了してくれるんだと思ってたけど、違うらしい・・・(多分)
嘘!
簡単なプログラム作ってみたら、違ってた。。。
ファイルのオープン数が多すぎて、落ちてた。
プロセス自体は、終了していても、ストリームが閉じていないのが、正解だった。
結論は、Processのストリームを明示的に閉じればOK。
http://java-house.jp/ml/archive/j-h-b/044382.html#body