Platform: All Platforms Versions: All versions

Problem Description

The error "Out of Memory" occurs.

Solution

Of the available memory (RAM and virtual memory), one section, the Java heap, is reserved for Java. The rest of the memory will be available for meshing and solving. If you receive the Out of Memory error, try to increase the Java heap.

Open the comsol.ini file located in the subdirectory bin/$arch in the COMSOL installation directory, where $arch corresponds to the platform you are using. Modify the number in the row that starts with -Xmx, its value is the Java heap size. If you have enough RAM, try doubling the size. By default, this value is -Xmx2g, so doubling it will give the line -Xmx4g for a 64-bit platform. Repeat this for all *.ini files in the same directory. For the LiveLink for MATLAB in particular, set -Xmx4g in the file comsolmphserver.ini.

If you are running out of memory when using LiveLink for MATLAB, also perform the same step for the mli/startup/java.opts file.

If you do not have write permission to the bin/$arch directory, you can instead try the following:

  • Copy the comsol.ini file to a folder where you have write permission.
  • Open the file and modify it according to the instructions above.
  • When you launch COMSOL, add the option -comsolinifile [path] to the COMSOL command, where [path] is the path to your new comsol.ini file.

See also:

Knowledge Base 1186: Out of memory during assembly

Knowledge Base 1030: Error: "Out of memory"