Understanding free heap memory
Posted: Sun Sep 09, 2018 11:42 am
I have long wondered why - in contrast to other MCUs architectures - there is so much discussion and speculation about free memory management on ESP32. This seems to be not only a compiler problem, as discussed here, but above all a general memory management problem and the understanding of the internal structure and its limits. Not only after compilation the memory usage is relevant, also during runtime the memory limits must be dynamically recognizable. I realize that this thread is not the best place for my question, but there is a strong inner relationship to the discussion in this thread, since there is obviously no really reliable information. There is too much speculation.
My question seems old but still unanswered: What exactly is the difference when calculating the heap with esp_get_free_heap_size() or with esp_get_minimum_free_heap_size()? I don't think the heap return value with esp_get_free_heap_size() is realistic enough, but when the value is used to allocate memory, there are crashes that indicate that apparently more than the largest possible allocable memory is mentioned. So why esp_get_free_heap_size()?
Any idea what the memory secrets are?
My question seems old but still unanswered: What exactly is the difference when calculating the heap with esp_get_free_heap_size() or with esp_get_minimum_free_heap_size()? I don't think the heap return value with esp_get_free_heap_size() is realistic enough, but when the value is used to allocate memory, there are crashes that indicate that apparently more than the largest possible allocable memory is mentioned. So why esp_get_free_heap_size()?
Any idea what the memory secrets are?