Increasing lag. lv_task_handler() takes longer each time it's called

I have an app that goes slower and slower the more I use it. It’s a simple UI with one small display and a few screens, a couple of which have countdowns. One has a progress bar. As you go through the workflow, from one screen to another it slows down over time and never recovers unless you reboot it. Logging has revealed that lv_task_handler() takes longer each time it’s called.

I’m guessing I need to free up resources by deleting something each time I leave a screen, but that hasn’t helped.

I’m very new to LVGL, the app I’m working on was written by someone else who is no longer involved.

This is running on an stm32h743zi, on FreeRTOS.

Any clues would be appreciated.

Thanks,
Tim

A couple things to check:

  • Are any LVGL tasks being created and never stopped? A lot of tasks running each time might be part of the problem.
  • When you move from one screen to another, you should delete the previous screen object so it doesn’t need to be “redrawn”.
  • Is lv_tick_inc being called at the correct speed? Does the speed at which it’s called change over time? I don’t think that would affect lv_task_handler's execution speed but it’s something to check.

Related to the second point here, when you update screens/views, are you recreating objects instead of updating them? If you create new objects when updating, you likely need to remove/delete the old ones.

1 Like

My guess it that you are always creating objects on screens and never deleted them. Due to this as time passes LVGL needs to draw a lot of overlapping objects.

Hi there, I’m sorry to resurrect this but I must admit I’m very interested in one statement:

  • When you move from one screen to another, you should delete the previous screen object so it doesn’t need to be “redrawn".

Is this really true?
I mean… of course, if you don’t need them you can - and probably should - delete them.
My question is more about the second bit: so it doesn’t need to be “redrawn".

If I understood correctly what’s in Drawing — LVGL documentation then I’d say that objects which are invisible, out of their parent, or on other screens are not “redrawn”.

In that case that wouldn’t explain the performance degradation.

Is that true or am I missing something?

Thanks in advance.

Cheers