Advanced Users can post their questions and comments here for the not so Newbie crowd.

Moderator: eriksl

User avatar
By eriksl
#88422 How do you guys check how much RAM you actually have left?

I learned that LWIP ("out of the box") uses quite some amount of RAM transiently, so even if you think you have, say, 3 kbytes left, sending or receiving of frames starts to fail.

So I configured LWIP to only use "static" memory (as a matter of fact I do not use "heap" memory anywhere) and then I saw that amount of "available" memory shrink considerately.

I think that on a tight-on-RAM microcontroller (without virtual memory) should not use a heap (or much stack) anyway, because it becomes unpredictable how much is really used and there may come a moment you're left with none, probably crashing the whole thing.