Skip to Main Content

Java HotSpot Virtual Machine

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!

java.io.IOException: Cannot allocate memory

843829Sep 20 2005 — edited Sep 25 2005
I am running jboss 4.0.2 with two applications deployed. I have manually removed services that are not needed to save memory.

The offending code:
String command = new String("/usr/local/bin/executeCreateMailDir " + ULV.getLoginId());
        try {
			Runtime.getRuntime().exec(command);
		} catch (IOException e) {
			System.out.println(Runtime.getRuntime().freeMemory());
			System.out.println(Runtime.getRuntime().totalMemory());
			throw new CreateException(e.getMessage());
		}
This is nothing more than a shell script which creates and sets permissions on a couple directories and runs courier's maildirmake. This code will throw the exeception every time with -Xms128m -Xmx128m. If, however, I set it to -Xms135m -Xmx135m. It will take a day or two before throwing it. The output of those two println's with Xmx128m is:
2005-09-20 22:35:16,812 INFO  [STDOUT] 91970128
2005-09-20 22:35:16,812 INFO  [STDOUT] 132775936
Here's the output of free immediately after the exception is thrown:
             total       used       free     shared    buffers     cached
Mem:        191236     188100       3136          0       1252      48524
-/+ buffers/cache:     138324      52912
Swap:       131064      24568     106496
Any ideas?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 23 2005
Added on Sep 20 2005
5 comments
745 views