Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

Run java in php apache2

General Tech Bugs & Fixes
Max. 2000 characters
Replies

usr_profile.png
Priya Roy

User

( 6 months ago )

I wrote a simple PHP file which calls a java application.

It runs on cli without problems but I can't run it on browser.

Output:

"Java HotSpot(TM) 64-Bit Server VM warning: INFO:os::commit_memory(0x00007ff590053000, 2555904, 1) failed; error='Permission denied' (errno=13) 
# # There is insufficient memory for the Java Runtime Environment to continue. 
# Native memory allocation (malloc) failed to allocate 2555904 bytes for committing reserved memory. 
# An error report file with more information is saved as: # /tmp/hs_err_pid14930.log "

How can I fix it?

usr_profile.png
Ekta Singhania

User

( 6 months ago )

It looks like you're hitting the maximum memory limit: Java is asking for around 2.5mb and cannot get it. Strange it's not that much, but most probably doens't include the JRE image itself so it will be much more.

Check and/or rise the PHP memory limit (/etc/php.ini), something like :

memory_limit = 128M

Depending on the configuration you could do it also in the .php itself:

ini_set('memory_limit', '128M');

In case posting the /tmp/hs_err_pid14930.log the error is refeering to would be very helpful aswell!

what's your interest


forum_ban8_5d8c5fd7cf6f7.gif