From: <php...@li...> - 2011-01-13 14:40:42
|
sorry, of course that command does not use 256 but only 128 MB. I use the same values for Xms and Xmx because it should be faster then continuously allocating more memory. On Thu, Jan 13, 2011 at 3:33 PM, Zagoti Bagon <za...@gm...> wrote: > Ok, i did some testing for you in a 1 GB virtual machine (virtual box - > ubuntu). > > The php-java-bridge starts a local servlet container. > But it doesnt stop it. So you should first check that > all java processes have terminated. > > ps -ef | grep java > > if there still is a java process, kill it. > > kill <pid> > (The pid is in the second column of ps -ef) > if this does not help: > kill -9 <pid> > > After that try this: > > java -Xms128m -Xmx128m -cp JavaBridge.war > > If it still complains about php-cgi, then as root: > > apt-get install php5-cgi > > Before you retry check again if the all java processes have terminated. > > I dont know if 256 M will be enough for your production environment. > > Regards > David > > > On Thu, Jan 13, 2011 at 1:23 PM, < > php...@li...> wrote: > >> Hi, >> >> thx for the help. It's a VPS with 1 GB real memory. I see the problem java >> does not let me change its max memory with >> >> java -Xmx512m (unknown identifier) >> >> instead I tried >> >> export JAVA_OPTS="-Xms256m -Xmx512m" >> export CATALINA_OPTS="-Xms256m -Xmx512m" >> >> running the testinstallation produced: >> >> >> Starting a simple servlet engine: >> [/usr/lib/jvm/java-6-openjdk/jre/bin/java, >> -jar, /opt/tomcat/webapps/ext/JavaBridge.jar, SERVLET_LOCAL:8080] >> Jan 13 13:15:45 JavaBridge INFO : VM : >> 1.6.0_0@http://java.sun.com/ >> Jan 13 13:15:45 JavaBridge INFO : JavaBridge version : 6.2.1 >> Jan 13 13:15:45 JavaBridge INFO : logFile : >> Jan 13 13:15:45 JavaBridge INFO : default logLevel : 3 >> Jan 13 13:15:45 JavaBridge INFO : socket : SERVLET_LOCAL:8080 >> Jan 13 13:15:45 JavaBridge INFO : java.ext.dirs : >> /usr/lib/jvm/java-6-openjdk/jre/lib/ext:/usr/java/packages/lib/ext >> Jan 13 13:15:45 JavaBridge INFO : php.java.bridge.base: /root >> Jan 13 13:15:45 JavaBridge INFO : thread pool size : 20 >> Jan 13 13:15:45 JavaBridge INFO : JavaBridgeRunner started on port >> INET_LOCAL:8080 >> Invoking php: [php-cgi, -n, -d, allow_url_include=On, >> /opt/tomcat/webapps/test.php] >> java.lang.RuntimeException: Could not run PHP ([php-cgi, -n, -d, >> allow_url_include=On, /opt/tomcat/webapps/test.php]), please check if >> php-cgi is in the path. >> at TestInstallation.start(TestInstallation.java:332) >> at TestInstallation.main(TestInstallation.java:252) >> Caused by: java.io.IOException: Cannot run program "php-cgi": >> java.io.IOException: error=12, Cannot allocate memory >> at java.lang.ProcessBuilder.start(ProcessBuilder.java:474) >> at java.lang.Runtime.exec(Runtime.java:610) >> at java.lang.Runtime.exec(Runtime.java:526) >> at TestInstallation.start(TestInstallation.java:330) >> ... 1 more >> Caused by: java.io.IOException: java.io.IOException: error=12, Cannot >> allocate memory >> at java.lang.UNIXProcess.<init>(UNIXProcess.java:164) >> at java.lang.ProcessImpl.start(ProcessImpl.java:81) >> at java.lang.ProcessBuilder.start(ProcessBuilder.java:467) >> ... 4 more >> >> And then >> >> Free -m (821 m free, prior it was already up to 1024m full an leaking) >> >> The question is how much real ram should I install to be safe. Whats with >> the message "please check if php-cgi is in the path" >> >> Thx for your help - appreciated >> >> -----Original Message----- >> From: php...@li... >> [mailto:php...@li...] >> Sent: Donnerstag, 13. Januar 2011 09:14 >> To: php...@li... >> Subject: Re: [Php-java-bridge-users] Installation of JavaBridge causes >> problems - what am i missing >> >> Hello, >> >> i had a similar problem in a different context. I guess your problem is >> not >> the php-java-bridge. >> On a virtual host you often have very limited memory available. How much >> memory did you order for your virtual server? >> >> You can use linux commands like >> free -m >> to find out how your current memory usage is. >> >> Look at your error message. Quite at the start it says: >> >> Caused by: java.io.IOException: Cannot run program >> "/usr/lib/jvm/java-6-openjdk/ >> jre/bin/java": java.io.IOException: error=12, >> Cannot allocate memory >> >> So find out how much memory you have available and then adjust the start >> scripts of the php test program and of your tomcat. >> Look for the java options -Xms and -Xmx >> Documentation: >> http://download.oracle.com/javase/6/docs/technotes/tools/solaris/java.html >> >> Also dont run too many jvm instances at the same time. I believe the >> php-java-bridge test programm starts its own jvm, so dont start the test >> while tomcat is runing. I think your virtual machine might not have enough >> memory for both instances. >> >> Regards, David >> >> >> On Wed, Jan 12, 2011 at 1:55 PM, < >> php...@li...> wrote: >> >> > Please see http://php-java-bridge.sourceforge.net/pjb/installation.php >> > >> > With "original software" I mean Java from Oracle and Tomcat from Apache. >> > The >> > crap shipped with Debian OS doesn't work. >> > >> > >> >> ---------------------------------------------------------------------------- >> -- >> > Protect Your Site and Customers from Malware Attacks >> > Learn about various malware tactics and how to avoid them. Understand >> > malware threats, the impact they can have on your business, and how you >> > can protect your company and customers by using code signing. >> > http://p.sf.net/sfu/oracle-sfdevnl >> > _______________________________________________ >> > php-java-bridge-users mailing list >> > php...@li... >> > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users >> > >> >> ---------------------------------------------------------------------------- >> -- >> Protect Your Site and Customers from Malware Attacks >> Learn about various malware tactics and how to avoid them. Understand >> malware threats, the impact they can have on your business, and how you >> can protect your company and customers by using code signing. >> http://p.sf.net/sfu/oracle-sfdevnl >> _______________________________________________ >> php-java-bridge-users mailing list >> php...@li... >> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users >> >> >> >> ------------------------------------------------------------------------------ >> Protect Your Site and Customers from Malware Attacks >> Learn about various malware tactics and how to avoid them. Understand >> malware threats, the impact they can have on your business, and how you >> can protect your company and customers by using code signing. >> http://p.sf.net/sfu/oracle-sfdevnl >> _______________________________________________ >> php-java-bridge-users mailing list >> php...@li... >> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users >> > > |