Error occurred during initialization of VM

Posted by
Updated onFebruary 1, 2023

Not happy with your web hosting service provider?

Approx. read time : 2 min

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”


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/
[root@server ~]$ /usr/local/jakarta/tomcat/bin/
[root@server ~]$ /usr/local/jakarta/tomcat/bin/ run

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


My name is Neha Khanna, I work for I am interested in posting content on various topics. I aim at posting informative articles that provide value to people.