IndianWebPortal.com

Something Different In Linux

Home » Tomcat » Error occurred during initialization of VM

Error occurred during initialization of VM

Posted by Rishikesh Vispute Categories: Tomcat

If  you are facing following error when restarting the tomcat service or check the java version on the server.

===============================
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
===============================

then  you need to increase the java heap size by using following commnad.

root@server [/]#export _JAVA_OPTIONS="-Xms20m -Xmx64m -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:NewSize=10m -XX:MaxNewSize=10m -XX:SurvivorRatio=6 -XX:TargetSurvivorRatio=80 -XX:+CMSClassUnloadingEnabled -XX:+CMSClassUnloadingEnabled"

Then restart the tomcat service on the server.

If you are facing same problem again and again on the server then add the following code into /etc/profile file.

Quote:
#cPanel Added Limit Protections — BEGIN

#unlimit so we can run the whoami
ulimit -n 4096 -u 14335 -m unlimited -d unlimited -s 8192 -c 1000000 -v unlimited 2>/dev/null

LIMITUSER=$USER
if [ -e “/usr/bin/whoami” ]; then
LIMITUSER=`/usr/bin/whoami`
fi
if [ “$LIMITUSER” != “root” ]; then
ulimit -n 100 -u 20 -m 200000 -d 200000 -s 8192 -c 200000 -v 200000 2>/dev/null
else
ulimit -n 4096 -u 14335 -m unlimited -d unlimited -s 8192 -c 1000000 -v unlimited 2>/dev/null
fi
#cPanel Added Limit Protections — END

Save and exit from the file and then logout from the server and login again and try to check the java -version .


Popular Posts

remove index.php fro

How to remove index.php from url in magento Ans : If you ...

PHP-Java bridge on p

  What is php-java bridge? The php-java bridge is the php ...

Set expiration for y

If you want to set the expiration to your site ...

Warning: Parameter 1

Error: Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a ...

domain pointing to e

If you domain uses external MX record and it is ...