This error is a bit annoying during the javac command:
Error occurred during initialization of VM
Could not reserve enough space for object heap

heap and stack sizes are often limited due to the virtualization

javac -J-Xms16m -J-Xmx48m MyClass.java

java -XX:PermSize=16M -Xms8m -Xmx48m

This can be set globally using an alias so that it doesn’t have to be specified it each time

To view the alias for java use $# which java