Cannot compile Modelica program as max memory allocation for array has been reached (Compiler is out of heap space)


I'm currently attempting to compile a Modelica program in Dymola. I have been running into issues which says the compiler is out of heap space (fatal error C1060), the total size of array must not exceed 0x7fffffff bytes (error C2148) and warning C4307: '*': signed integral constant overflow.

I've tried setting the compiler flag to /Zm in order to increase the allocation of memory upon compile, as well as setting Advanced.CompileWith64=2. So far I have had no success in compiling my program, any suggestions would be appreciated.

Here are some websites I've visited that might help:

asked on Stack Overflow Sep 19, 2020 by G_Pic

1 Answer


To me there are two likely explanations:

  • You use a large table that is included in the C-sources. The best solution is to have the table externally (using Modelica.Blocks.Tables.CombiTable* or similarly), possibly with 64-bit compilation (so that it fits in the address space).
  • Something went wrong in the translation and the array shouldn't be that large, and in that case it's difficult to say more without the model.
answered on Stack Overflow Sep 21, 2020 by Hans Olsson • edited Sep 21, 2020 by Hans Olsson

User contributions licensed under CC BY-SA 3.0