How can I increase memory allocation (heap) for MCUXpresso 11.2?
I work with the MIMXRT1064-EVK and use the internal Flash for the program (1.5 MB) and I have enabled the External HyperFlash to hold my TensorFlow lite model, it is approximately 13 MB.
When building my project MCUXpresso seems to run out of memory to allocate. I get the following message:
cc1plus.exe: out of memory allocating 134221823 bytes
make: *** [source/model/subdir.mk:21: source/model/or_model.o] Error 1
make: *** Waiting for unfinished jobs....
This happens when I add a larger 12MB TFlite model to be included with the project.
Just to be clear, it is the IDE in itself that runs out of memory.
Since it has a heap that shows to have a max size of 1874M, using around 830M, I do not understand why it runs out of memory allocating 134MB?
I appreciate any answer or suggestion to what I can do to fix this.
Just to be really clear, this is NOT the IDE, but the compiler (cc1plus.exe). I know of no way to increase the heap for the compiler. Suggest you post on the gnu gcc forum.
Thanks for your answer. It is correct that it is the compiler runs out of memory, I wasn't clear on that, just tried to explain that it was not on the embedded target I had the memory problem. There seems to be enough free memory available for the 134 MB it needs but I am not clear on why it can't use all memory available.
I tried to free more memory on my PC by shutting down all other programs and possibly reduce MCUXpressos memory use but it was not enough, seems as if there is some limit on the compiler's memory usage, I had no luck finding further info on that.
The solution I can see is to separate the program and the model and just have the link to the model in the program code and upload the model separately to the board flash.
Without the model in the source code, the program compiles fine so that approach seems to work.
In Windows, maximum heap size is defined by the programmer when building the executable. It has nothing to do with the amount of RAM on your PC. Shutting down applications will have no affect at all.
anyway, glad you have found a solution.