Effective Memory Management
Especially in 3D modeling, extensive memory usage requires some extra precautions. First, check that you have selected an iterative linear system solver. Normally you do not need to worry about which solver to use because the physics interface makes an appropriate default choice. In some situations, it might be necessary to make changes to the solver settings and the model. For details about solvers, see the Studies and Solvers chapter.
Estimating the Memory Use for a Model
Out-of-memory messages can occur when the COMSOL Multiphysics software tries to allocate an array that does not fit sequentially in memory. It is common that the amount of available memory seems large enough for an array, but there might not be a contiguous block of that size due to memory fragmentation.
In estimating how much memory it takes to solve a specific model, the following factors are the most important:
The MUMPS and PARDISO out-of-core solvers can make use of available disk space to solve large models that do not fit in the available memory.
You can monitor the memory use in the lower-right corner of the COMSOL Desktop, where the program displays the amount of physical memory and total virtual memory used (see Information About Memory Use).
Creating a Memory-Efficient Geometry
A first step when dealing with large models is to try to reduce the model geometry as much as possible. Often you can find symmetry planes and reduce the model to half, a quarter, or even an eighth of the original size. Memory usage does not scale linearly but rather polynomially (Cnk, k > 1), which means that the model needs less than half the memory if you find a symmetry plane and cut the geometry size by half. Other ways to create a more memory-efficient geometry include:
Information About Memory Use
In the lower-right corner of the COMSOL Desktop is information about how much memory the COMSOL Multiphysics software is currently using. The two numbers in Figure 3-13 displayed as 1.58 GB | 2.73 GB represent the physical memory and the virtual memory, respectively. If you position the cursor above these numbers, the tooltip includes the numbers with the type of memory explicitly stated:
The Physical memory number is the subset of the virtual address space used by COMSOL Multiphysics that is physically resident; that is, it is the amount of physical memory (RAM) in “active” use.
The Virtual memory number is the current size of the virtual address space that the COMSOL Multiphysics software uses.
Figure 3-13: An example of memory use displayed in the COMSOL Desktop.