E Armitage wrote:Are you on a 32 bit VM or 64 bit and what are your memory settings?
Does it work if you start the java program with -mx256m or -mx512m?
Thanks for replying,
64 bit, and no it doesn't
java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) 64-Bit Server VM (build 10.0-b23, mixed mode)
That doesn't look correct. Look here; I think that is the Windows® version, but I don't think there are significant differences for other versions. I think it is
java -Xmx512M Foo to run the Foo class' main method with a maximum space of 512MB.
Campbell Ritchie wrote:That doesn't look correct. Look here; I think that is the Windows® version, but I don't think there are significant differences for other versions. I think it is
java -Xmx512M Foo to run the Foo class' main method with a maximum space of 512MB.
I don't know how to find that - I am using shared hosting
Well, how much memory does this hosted machine have? It doesn't matter what you memory setting are -- if you don't actually have enough memory allocated to run the JVM.
Henry Wong wrote:Well, how much memory does this hosted machine have? It doesn't matter what you memory setting are -- if you don't actually have enough memory allocated to run the JVM.
Henry
It seems to have enough memory if I am running the command via ssh - but when I run same command, same user (whoami verifies), via PHP script, suddenly it doesn't have enough memory?
Allasso Travesser wrote:
It seems to have enough memory if I am running the command via ssh - but when I run same command, same user (whoami verifies), via PHP script, suddenly it doesn't have enough memory?
Running the PHP interpreter (along with the PHP scripts) takes more memory than running nothing. So, running PHP with JVM needs more memory than just running the JVM.
Regardless, it is your decision. The error is reporting that it doesn't have enough memory. You can choose to examine other possible factors first.
Allasso Travesser wrote:
It seems to have enough memory if I am running the command via ssh - but when I run same command, same user (whoami verifies), via PHP script, suddenly it doesn't have enough memory?
Running the PHP interpreter (along with the PHP scripts) takes more memory than running nothing. So, running PHP with JVM needs more memory than just running the JVM.
Regardless, it is your decision. The error is reporting that it doesn't have enough memory. You can choose to examine other possible factors first.
Henry
I suppose then it is a problem with the service provider not allocating enough memory?
[ Moderator edit - corrected the quote tags at Ranch time Nov 27, 2013 11:37:45. ]
What OS is this on? On unix you can check the memory using free -m. (Run that with the PHP engine started)
You are going to need to know how to pass memory settings to your program, especially if you are going to run it on a shared host.
Read your PHP manual on the shell_exec command to find out how to execute your program with the correct memory settings. But first find out how much memory you actually have like Henry said.
Create symphonies in seed and soil. For this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth