My system is Mint 12 64bit.
I've installed the typesafe stack and created a new play application. Without modifying the code I've tried to run it. This is the output:
Play complains with this error message:
IOException: Cannot run program "javac": java.io.IOException: error=12, Cannot allocate memory
How can I fix this ?
UPDATE:
@Mef
Ok you were definitely right. I've increased the initial RAM from 1 GB to 2 GB (running this on virtualbox). Compiling worked exactly once.
Unfortunately java has made up his mind that even 2 GB aren't enough: Running eclipse and firefox my system uses 1 GB. Then I start sbt and the memory usage rises to about 1.2 GB. One might think that this is sufficient. It isn't. Compilation fails with the same error although 800 MB are still available. Moreover after trying to compile the application the memory usage goes up to 1.6 GB. Strangely enough even while compiling the project it never reaches 2 GB but peaks at about 1.8 GB.
Nevertheless I've tried again and fed 3 gigs of RAM to the virtual machine. Now compiling and running the application works fine. As another miracle with 3 GB available the memory usage never rises above 1.6 GB and stays well below the maximum of 1.8 GB that I saw in the 2 GB iteration.
Since this is a general
javac
error, I doubt that it is Play related. Most likely you really ran out of memory.Actually this is not entirely a system error: tweaking the play config files will allow you to make it work on a system with less than 1GB of memory.
In
play-2.0.4/framework/build
(orbuild.bat
), you just need to changeto
Now there can be other issues running play with less memory, but at least the basic setup works.
This is very well described in another post and it seems to be a problem with OpenJDK.
How to solve "java.io.IOException: error=12, Cannot allocate memory" calling Runtime#exec()?
Try the following:
This has worked for me :-)