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: