-
-
Notifications
You must be signed in to change notification settings - Fork 922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce RAM overhead and free ~9kB of memory #911
base: main
Are you sure you want to change the base?
Conversation
…GL and tasks stack and free ~9kB of RAM.
This version has just crashed on my PineTime just after secure pairing with my phone. Maybe a buffer is a bit too tight? I'll debug this asap! |
Don't forget that I already adjusted the BLE and LL stack sizes in #796 (1.8.0). |
I just found the same thing. |
I just tried building this with the BLE/LL stack sizes as before (600/200) and the watch resets during boot before getting to the watchface. |
Thanks for those tests :) I haven't had the opportunity to analyze those issues deeper, but I have probably overlooked something... As @evergreen22 said, the stack of BLE tasks were increased for secure pairing, and I reduce them in this PR, which is probably wrong... |
I figured the same, but putting them back to their previous values makes it not boot. I assumed some other 'container' in which they reside needed to be increased to make room, I figured it'd be the FreeRTOS heap but apparently not? I'll keep fiddling! |
any news @JF002 , is this still crashing ? |
I haven't taken the time to check out these changes yet. I think I was a little too aggressive with the stack size reduction. |
Using
SystemMonitor
, I checked the memory usage of the global heap, the FreeRTOS heap, the LVGL heap and the stack of the task.Here are the results on develop (e0013e7):
This PR reduces the following buffers:
And the following stacks:
In total, this PR frees 10507B of RAM memory, which is quite nice! This memory has always been available, but it was over-allocated in those buffers. Reducing the size of the buffers according to the needs of the current code allows us to have a better overview of the memory currently available.
How to test this PR ?
You can build this branch with RTT logging enabled to check the logs from the
System Monitor
.Most of those info are also available in the SystemMonitor app in InfiniTime.
What should you check?
Example on my sealed PineTime running for ~10hours: