However of course the method also returns a Process object, which itself will use a bit of the JVM memory, but that will be just a few variables to keep track of the process that was launched, so unless you start tens of thousands of processes in parallel this should not be an issue. Hence, the command itself will be run in its own process with its own memory and will not use any of the JVM memory. The javadoc for Runtime.exec states that the command will be started in a separate process. If you are on Java 8 or later, please also see this question: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize Memory Allocated to Command Line Program Invoked through Java
0 Comments
Leave a Reply. |