- Sun Aug 30, 2020 3:47 am
#88551
I'd guess Arduino does it's own memory management (or at least a layer on top of the SDK code) and I also assume it will need some (dynamic) memory itself.
I work the other way around, I have eliminated all calls to malloc in my own code, I have configured LWIP to only use static pools of memory and also I have eliminated as much calls to SDK code as possible (and replaced it by own implementations or libc). Still some dynamic memory is used, probably in the WLAN handling code, but it's only ~500 bytes.
I never experiences issues that come down to memory leakage or temporary out of memory conditions.
Anyway, how did we come here: use of TLS. I think it needs a lot of memory. I now have ~7500 bytes free, which I got myself by painstakingly move ALL read-only data to flash, otherwise I wouldn't have any memory spare, even about 12 kilobytes short. So it's not possible to free up another few kb's just for TLS.
Having said that, newlib uses quite some space for temporary storage of non-reentrant threaded function calls ("impure data"). I have managed to get it down considerately, but it's still about 240 bytes. Anyone a idea how to get rid of it completely (see also other topic)?
Oh BTW, at 0x3fffe000 - 0x3fffeb2c, there seems to be quite a chunk of DRAM (NON-OS SDK) that's only used once during startup. I am using it for storing logging data. It might be used if you use more of the SDK functions than I do of course