Large Memory Footprint

I have a project with 6 screens each 480x320 in size, and 200 widgets spread across them. I have had to increase the LV_MEM_SIZE multiple times or the app crashes with “LoadProhibited” randomly when creating additional widgets at runtime (e.g. when displaying a MessageBox).

I think the problem is the SquareLine code creates ALL the widgets for all screens in the ui_init method in ui.c whether the screens are going to be shown or not. This is proving to be a limitation on building an app with many widgets.

I think there needs to be an option to have the ui_X_screen init method get called from the SCREEN_LOADING event or somewhere else only when they are needed. If this option exists, I cannot find it currently.

I am currently up to this amount of memory, and my SSL processes have stopped working because LVGL is using most of the heap.

#define LV_MEM_SIZE (82U * 1024U)

Example: some of the screens are very transient. I have one to enter your WiFi credentials. This really is only ever used once, when the app first runs, so it’s a waste to have this residing in memory indefinitly.

You can do it yourself. Create only empty screen and activate event onload / unload.
But yes better is in SLS can choice this on selectable screen checkbox.
Ofcourse loading screen slow down with this.

I was playing with moving the init functions around so achieve this, but when i generate new UI code it overwrites things, so that is doable but not ideal.

We were also thinking about it, but it’s not supported yet.
I’ll bring up this topic internally again.


If you place into ui events, isnt overwrited.
I preffer create slim screens in SLS and add on the fly only special big objects removed on unload.