Software 152 da Shihai
1. Find the MATLAB root path. In the MATLAB command line, typing: matlabroot
Displays the root path, such as: C:\MATLAB7
2. View the current Java Virtual machine max heap memory, typing: java.lang.Runtime.getRuntime.maxMemory
3. View the Java Virtual Machine version. Typing: Version-java
4. Create a new java.opts file under $MATLAB \bin\ $ARCH path.
$MATLAB is the root path, for example C:\MATLAB7
$ARCH is the system architecture. For example Win32, create a new java.opts file under C:\MATLAB7\bin\win32.
5. Open the Java.opts file with Notepad,
For different versions of the Java Virtual machine, enter:
The following table shows the default settings MATLAB uses for versions of the JVM:
JVM Initial Heap Size Max Heap Size
1.6.0-xms64m-xmx128m (32-bit)
-xmx196m (64-bit)
1.5.0-xms64m-xmx96m (32-bit)
-xmx128m (64-bit)
1.4.2-xms16m-xmx96m
1.3.1-xms16000000-xmx64000000
1.2.2-xms16000000-xmx64000000
1.1.8-ms16000000-mx64000000
For example, my Java is 1.4.2, in the java.opts file write-xmx96m, save is OK
If an error is entered: warning:failed to start to Java Virtual machine
6. Restart Matlab, typing java.lang.Runtime.getRuntime.maxMemory
Displays the maximum memory change, setting is successful.
Java Virtual machine memory not enough solution