Using Runtime.getRuntime().exec() in java
This is not well documented by Sun but if you make a call using Runtime.getRuntime().exec() you should always get a reference to the Process object that's returned. When you're done with the Process you should either:
- Explicitly get and close the input, output and error streams for the Process, whether you've used them or not
or
- Call Process.destroy()
If you don't make these calls you will leak resources. Once you start leaking resources you may start to see "IOException: Broken Pipe" errors
0 comments:
Post a Comment