memory usage should not be increased when switching the screen every time
What have you tried so far?
if there are no animations on the screen ,then no memory leak (mem uasage not increase) even though i switch the screen to each, i cant find the reason of the menory leak,do i need to free the image obj manually? by the way, i use freeRTOS memory management, i am not sure whether it will accur the same problem on lvgl mem management
when I try to switch the screen by the button ,the mem size usage is as the picture shows,the animation is created by squareline with a pic,
however, when I continue to switch the screen many times , it seems that the usage of the mem becomes bigger and bigger ,which must lead to the mem problem finallly.
begin usage:23% final usage 30%.
In the meantime, i have try the mem menagement of freeRTOS ,it also has the problem like that, my question is :do I need to free the animation obj with the API manually ?how i can avoid this problem.TKS
It means the animation is created every time the screen is loaded. In SLS we should have on “starter” object or so where the user can start all the one-time init things (e.g. animations) but we don’t have this yet.
As workaround we usually create a splash screen and in the splash screen’s SCREEN_LOADED event start the animations and immediately switch to the real first screen.
Tkanks for your following about this problem, i also try to use the GC function like “lv_anim_del()” to clear the mem before load the another new screen ,it really works just on the condition that there are no other animation on the other screen ,but it’s not so good.All in all, i hope the object of container or titleview widget can be used in the next version of SLS, then it will be easy to build the Sliding main menu of UI,which i think it’s a commonly usage for the GUI proj’