-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Our services occasionally see an error like this:
java.io.IOException: Cannot run program "chmod": java.io.IOException: error=12, Cannot allocate memory
This happens running very minor commands like chmod, while the system has a decent amount of free memory.
root@ip-10-10-0-90:/var/lib/tomcat6/logs# free
total used free shared buffers cached
Mem: 1013336 1001500 11836 0 2284 48240
-/+ buffers/cache: 950976 62360
Swap: 524284 402660 121624
I believe this is because we are shelling out from tomcat, which is a Unix fork, which by default copies the process memory.
We can work around this for now by throwing more memory at the system, but we should move to a lighter weight process spawn, like:
https://github.com/axiak/java_posix_spawn
It may be that moving to standard Sun JDK would solve the problem as well:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7034935