ProcessBuilder memory usage on linux
860635May 9 2011 — edited May 23 2011I have a large java server process containing several gigs of memory. It's using ProcessBuilder to try and execute some lightweight commands (e.g. ls), but i am continually running into java.io.IOException: error=12, Cannot allocate memory. It seems that ProcessBuilder is using fork/exec to run my command and the fork call is trying to duplicate all the memory in use by the JVM, which the system cant handle. Is there anyway to get java to spawn a new process without duplicating all of the memory used by the JVM?