java.io.IOException: Not enough space
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.(UNIXProcess.java:53)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
at java.lang.Runtime.exec(Runtime.java:591)
at java.lang.Runtime.exec(Runtime.java:464)
...
My programe use the below method to create the process:
...
for(int i = 0; i <=10000; i++) { Process process = Runtime.getRuntime().exec(new String[] {"/home/kongxx/test.sh}); ... } ... If the programe run some time, the above exception was thrown out.
After investigation, I found the java need some /tmp space to fork a new process, but in my test environment the /tmp only has less than 5xxM space. So when the /tmp space is not enough to create a new process, the exception appeared. For this reason, I extends the /tmp space and re-run my programe, it worked well.
for(int i = 0; i <=10000; i++) { Process process = Runtime.getRuntime().exec(new String[] {"/home/kongxx/test.sh}); ... } ... If the programe run some time, the above exception was thrown out.
No comments:
Post a Comment