A few days ago I began encountering a java.lang.OutOfMemoryError: Java heap space exception on startup of MATLAB - before I run any piece of code or add anythin
Refer this How do I increase the heap space for the Java VM in MATLAB 6.0 (R12) and later versions?
EDIT
-Xms sets the initial size of the heap. Changing this will have no effect on java.lang.OutOfMemory errors. The option to use is -Xmx which sets the maximum size of the heap. See here for details.