While restarting the red5 service on the server, If you get following error
——————BEGIN SESSION——————
root@server [~]# cd /usr/local/red5/dist
root@server [/usr/local/red5/dist]#./red5.sh &
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
===============================
Then the best solution for this error is to use the following command. This command will increase the java heap size.
| 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” |
Be sure that it ends with a ” if it is missing add it manually. Then restart the red5
root@server [~]# cd /usr/local/red5/dist
root@server [/usr/local/red5/dist]#./red5.sh &
If you are facing same problem “Error occurred during initialization of VM” again and again on the server then the problem is with the ulimit setting. If it is a cpanel/WHM server then add the following code in the start of the /etc/profile file.
| #cPanel Added Limit Protections — BEGIN
#unlimit so we can run the whoami LIMITUSER=$USER |
Save and exit.
Log out and login again (or start another session) for these changes to take effect.
