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:+CMSPermGenSweepingEnabled” |
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.
| #cPanel Added Limit Protections — BEGIN
#unlimit so we can run the whoami LIMITUSER=$USER |
Save and exit from the file and then logout from the server and login again and try to check the java -version .







