Allocating Memory
COMSOL Multiphysics stores the data in Java®. If you are experiencing memory problems during meshing, postprocessing operations, or when exchanging data between the COMSOL server and MATLAB®, this can mean that the Java heap size is set with too low a value.
Either set The COMSOL Multiphysics Server Java Heap Size or Setting Manually the Memory in MATLAB.
The COMSOL Multiphysics Server Java Heap Size
The Java heap size settings for the COMSOL Multiphysics Server process are stored in the comsolmphserver.ini file. You can find this file in the COMSOL55/Multiphysics/bin/<arch> directory. <arch> correspond to the architecture of the machine where the COMSOL Multiphysics Server is running (win64, maci64, or glnxa64).
Edit the file with a text editor, the Java heap settings are defined as in the following lines:
-Xss4m
-Xms40m
-Xmx1024m
-XX:MaxPermSize=256m
The values are given in Mb, modify these value to satisfy the model requirements.
Setting Manually the Memory in MATLAB
To modify the Java heap size you need to edit the java.opts file available under the COMSOL with MATLAB start-up directory. The java.opts file is stored by default with the following settings:
-Xss4m
-Xmx768m
-XX:MaxPermSize=256m
The values are given in Mb, modify these value to satisfy the model requirements.
To modify the MATLAB Java Heap size the java.opts file has to be stored at the MATLAB start-up directory. This is the case when starting COMSOL with MATLAB.