There is 320k but only 176k can be used for static memory with current linker scripts. But the heap can still use it.kolban wrote:My understanding is that when we compile an application, from a RAM usage perspective, some will be initialized RAM (.data), some will be uninitialized data (.bss). Sum those together and we have the amount of RAM that is pre-allocated by the application. Within the ESP32 there is an available amount of RAM which I think is on the order of 180K. We subtract 180K - .data - .bss and what is left then becomes heap accessible storage. When you perform malloc() requests (explicitly or implicitly) this is drawn from heap. That includes creating FreeRTOS tasks whose stack (if I understand it correctly) are also drawn from heap.
Compiler does not report space taken by big char arrays??
Re: Compiler does not report space taken by big char arrays??
Re: Compiler does not report space taken by big char arrays??
We seem to have got another limit, since the memory appears to be segmented.WiFive wrote: There is 320k but only 176k can be used for static memory with current linker scripts. But the heap can still use it.
"region `dram0_0_seg' overflowed" happens with a declared array of around 110.000 bytes on an else empty sketch.
Re: Compiler does not report space taken by big char arrays??
An "else empty sketch" isn't really nothing though because it is built on top of esp-idf freertos and reserves 64k for bluetooth
Re: Compiler does not report space taken by big char arrays??
That's clear. The reserved memory should already have been accounted for by the compiler when reporting the amount of of dynamic memory, and the left bytes for local variables, shouldn't it?WiFive wrote:An "else empty sketch" isn't really nothing though because it is built on top of esp-idf freertos and reserves 64k for bluetooth
Your statement leads me to two additional questions:
- is freeRTOS already on board, usable without additional include?
- if bluetooth is not required, can I release that memory with the Arduino IDE?
Who is online
Users browsing this forum: No registered users and 140 guests