Error occurred during initialization of VM

Updated on 1 February 2023 2 min Read

Using CATALINA_BASE:   /usr/local/jakarta/tomcat
Using CATALINA_HOME:   /usr/local/jakarta/tomcat
Using CATALINA_TMPDIR: /usr/local/jakarta/tomcat/temp
Using JRE_HOME:        /usr/local/jdk
Using CLASSPATH:       /usr/local/jakarta/tomcat/bin/bootstrap.jar
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

You will receive error above the time you stop/start tomcat on linux cPanel servers. This is because the assigned heap size is insufficient. An alternative is to increase the heap size depending on the RAM allocated to your server.

There are 2 ways you can increase the heap size. Login to your server via SSH & use one of the command below.

export CATALINA_OPTS=”-Xms1024m -Xmx1024m”

OR

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:+CMSPermGenSweepingEnabled”

Once done you will need to restart tomcat.

[root@server ~]$ /usr/local/jakarta/tomcat/bin/shutdown.sh
[root@server ~]$ /usr/local/jakarta/tomcat/bin/startup.sh
[root@server ~]$ /usr/local/jakarta/tomcat/bin/catalina.sh run

For VPS hosting service, unmanaged VPS hosting and also all other type of hosting solutions, you can consider MilesWeb.

The Author

Neha Kahnna is a professional content writer associated with MilesWeb. She curates articles on web hosting, latest SEO trends and technology topics. Her insightful content captivates the reader’s attention and deliver a higher learning ROI.