Java Virtual machine memory not enough solution

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.