-
Notifications
You must be signed in to change notification settings - Fork 112
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
[LVGL] Add options to improve memory usage of LVGL projects #277
Comments
I implemented support for uncompressed assets data. Until now, so called assets data (pages, flows, global variables, ... definitions) was stored in compressed (LZ4) form in FLASH memory and decompression of that data was done during startup in RAM or SDRAM and after that used from there. This was done in that way because it was wanted to optimize the consumption of FLASH memory with the assumption that there is a large SDRAM memory. Since it is mainly read only data (i.e. only global variables are read write) it makes sense to keep it all the time in the FLASH memory if one wants to optimize RAM consumption. In order to achieve this, assets data must be written to flash in uncompressed form. To store assets data uncompressed inside FLASH memory following changes are required:
There is also some changes in eez-framework to support this, so pull the latest version. |
Flow execution queue size can be adjusted also. By default, memory for 1000 entries is reserved. You can change this to some smaller value by putting the following line in
But, you must determine value that works for you empirically. You can get the max. value used so far by calling |
I found myself in the same need of delete LVGL screens resources when they are not active, I'm working in a project with a lot of different screens and it would be very helpful. Do you know any alternative that I could use now? |
Current implementation creates all LVGL screens, widgets and corresponding flow states and variables at startup and keeps them active in memory. This requires a large LVGL memory pool if the amount of screens/widgets grows, even if the screen is only showed once or rarely. Even for simple screens the LVGL memory is considerable.
The same applies to the flow states, but I'm not sure if there is much to be gained here in effort vs. memory usage reduction.
Example use case:
Raspberry Pi Pico with 264KBytes of RAM and 2MBytes of FLASH. The flow has 7 screens (of 320x240) with around 100 widgets, 50 native variables and 25 local variables in total. Static memory allocations are now:
I suspect this is a common issue with a lot of MCU's where RAM is limited.
Point of attention: Will the LVGL memory pool implementation keep the fragmentation low to keep functioning properly with a limited pool size?
The text was updated successfully, but these errors were encountered: