Could not reserve enough space for object heap

While restarting the red5 service on the server, If you get following error

——————BEGIN SESSION——————
root@server [~]# cd /usr/local/red5
root@server [/usr/local/red5]#sh 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 is to increase the RAM available to the red5. Locate red5.sh, it is on the red5 folder and replace this line:

Code:
export JAVA_OPTS="$LOGGING_OPTS $SECURITY_OPTS $JAVA_OPTS"

with

Code:
export JAVA_OPTS="-Xms512m -Xmx1024m $LOGGING_OPTS $SECURITY_OPTS $JAVA_OPTS"
And restart red5.sh
On our server s at Hosting Marketers, and Red5 Server we actually give more RAM to red5:
Xms1024m and Xmx2048m
This really depends on the kind of machine you have and the RAM available.