Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ProcessBuilder memory usage on linux

860635May 9 2011 — edited May 23 2011
I 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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 20 2011
Added on May 9 2011
34 comments
6,052 views