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?