COMSOL and the Java Heap Space
The COMSOL executable programs are Java applications, which are only allowed to use a limited amount of memory. This limit, the Java heap space, is specified during application startup. By default, COMSOL allocates 2 GB of Java heap space memory, which should be sufficient for almost all cases. If you, for a large and complex COMSOL model, get a Java out-of-memory error, you can increase the size of the Java heap by specifying the Java virtual machine (JVM) parameters -Xmx. You find that parameter in the configuration settings (*.ini) files for all COMSOL programs, in the platform directory for your COMSOL Installation. For example, for the COMSOL Multiphysics main desktop program:
C:\Program Files\COMSOL\COMSOL64\Multiphysics\bin\win64\comsol.ini
In that file, change the line
-Xmx2g
to
-Xmx3g
to increase the Java heap space from 2 GB to 3 GB, for example.