java.lang.OutOfMemoryError

General discussion forum for the Zend Server
Post Reply
sdonalder
Posts: 4
Joined: Thu Mar 26, 2009 3:31 pm

java.lang.OutOfMemoryError

Post by sdonalder » Thu Mar 26, 2009 3:36 pm

Hi!

I get this error when I try to use JavaBridge (Zend Server, CE, Beta2):

Code: Select all

Fatal error: Uncaught exception 'JavaException' with message 'Java Exception java.lang.ClassCastException: java.lang.OutOfMemoryError cannot be cast to java.lang.Exception java.lang.ClassCastException: java.lang.OutOfMemoryError cannot be cast to java.lang.Exception ' in /home/pbl/public_html/ECMS/Extension/Module/J_PBL_Java/Frontend.class.php:37 Stack trace: #0 /home/pbl/public_html/ECMS/Extension/Module/J_PBL_Java/Frontend.class.php(37): *No Class!*->jbridge('pbl.facade.Faca...', '77.105.3.157:oc...', 'jdbc:mysql://19...', 'pbl_java', 'pbl') #1 /home/pbl/public_html/ECMS/Extension/Module.class.php(78): ECMS__Extension__Module__J_PBL_Java__Frontend->Practice() #2 /home/pbl/public_html/ECMS/Controller/Module.class.php(49): ECMS__Extension__Module->Run() #3 /home/pbl/public_html/ECMS/Controller/Page.class.php(70): ECMS__Controller__Module->LoadFrontend(Object(stdClass), Object(stdClass), Array) #4 /home/pbl/public_html/ECMS/Controller/Request/Page.class.php(25): ECMS__Controller__Page->LoadModules(Object(stdClass)) #5 /hom in /home/pbl/public_html/ECMS/Extension/Module/J_PBL_Java/Frontend.class.php on line 37
Server works some time but, when there are more than few requests at the same time, java bridge stops responding (client waits forever) or returns this error.

(top command on linux shows 100% processor usage before this error or blockade)

massi_zend
Posts: 15
Joined: Fri Jan 30, 2009 9:25 am

Re: java.lang.OutOfMemoryError

Post by massi_zend » Thu Mar 26, 2009 5:44 pm

We would need some more data to properly debug the problem.

Could you please provide the output of the 'bugreport.sh' tool located under /usr/local/zend/bin, along with the Java classes that are failing?

Thanks in advance,
Massi.

sdonalder
Posts: 4
Joined: Thu Mar 26, 2009 3:31 pm

Re: java.lang.OutOfMemoryError

Post by sdonalder » Thu Mar 26, 2009 7:07 pm

Hi Massi!

I've sent you a link to debug via PM. I have no source code of .jar but I'll ask author if he can give this.

We (at software laboratory at university) are very interested in developing PHP/Java applications. We were using PHP/Java bridge from php-java-bridge.sourceforge.net. Now, we are testing Zend Server's bridge implementation.

Where can we find appropriate documentation?

We have option to use java session on Jost Bökemeier's PHP/Java bridge. Is it possible with Zend's implementation?

Best regards,
Aleksandar

massi_zend
Posts: 15
Joined: Fri Jan 30, 2009 9:25 am

Re: java.lang.OutOfMemoryError

Post by massi_zend » Fri Mar 27, 2009 7:02 pm

Thanks for helping us make a better Java Bridge system.

You can find additional Java Bridge info on following links:
http://www.zend.com/en/products/platfor ... ava-bridge
http://static.zend.com/topics/Zend-Plat ... 60-new.pdf [under the Java Bridge section, page 219]

Sorry but I do not understand what you mean with "I've sent you a link to debug via PM."

I will look in our archives if I can provide more documentation regarding the Java Bridge.

Best regards,
Massi.

User avatar
zvika
Zend Global Support
Posts: 997
Joined: Sun Dec 14, 2008 9:48 am
Contact:

Re: java.lang.OutOfMemoryError

Post by zvika » Sun Mar 29, 2009 1:32 pm

Hello

Please try to backup and edit the file /usr/local/zend/etc/watchdog-jb.ini

Between "/usr/bin/java" and "-Dzend.javamw.threads=20" insert this:
-Xms128M -Xmx256M

Result should be somethine like:
zend_wd.process.java_daemon=/usr/bin/java -Xms128M -Xmx256M -Dzend.javamw.threads=20 [...]

As far as I know, the default limit is 64M, so this should start off with 128 and max upto 256

After editing and saving, restart Java Bridge daemon with
/usr/local/zend/bin/zendctl.sh restart-jb

Please provide feedback if it is helpful or not.
Thanks
Zvika Dror
Zend Support Team

Post Reply