InfiniTimeOrg / InfiniSim

Simulator for InfiniTime user interface without needing a PineTime
GNU General Public License v3.0
164 stars 66 forks source link

Free memory budget is wrong #128

Open ljahn opened 10 months ago

ljahn commented 10 months ago

The memory budget displayed when pressing p is wrong. It overestimates the free space left by a substantial amount (I think around 15000). I am pretty sure this comes from not considering FreeRTOS tasks getting their stack allocated on the heap on creation, now that the heaps were unified.

JF002 commented 10 months ago

This is probably a side effect of the new heap memory management we introduce a few months ago.

Previously, the memory usage displayed in InfiniSim showed the status of the LVGL heap memory. With this new memory management, all 3 memory heaps of InfiniTime (FreeRTOS, LVGL and Nimble) are merged into a single one managed by FreeRTOS. In InfiniTime, we ensured that all runtime memory allocations are done in this single heap.

In InfiniSim, this is much more complicated since it does a lot of memory allocations that do not happen in InfiniTime (SDL, for example). So that it's not that easy to catch memory allocations that are done by InfiniTime and filter out the ones that are done by InfiniSim.

So... yeah, the memory usage in InfiniSim might be wrong, and I do not know yet how we'll fix it :/