Refresh rate dips after several hours

I have an ESP32 project using SmartMatrix that works well for several hours. When I come back to it, the update speed has dropped, and according to my logging, the refresh rate has dipped form an initial 85Hz to a mere 19Hz.

Can anyone tell me what would cause this? I’m not seeing evidence of a memory leak. It takes hours to manifest at times, and the only other symptom is CORE_1 is very busy (my drawing is on CORE 0, and I am NOT passing SMARTMATRIX_OPTIONS_ESP32_CALC_TASK_CORE_1).

Hi, my blind guess is that you run code which passes ever increasing numbers to trigonometric functions. If so, use fmod to avoid this.

If not please show the code you run.

The code is all on github at, but it’s a large project so not practical to show even just the matrix code here…

Some of the effects are integer only, so unlikely to be a floating point issue, I think.

It’s not my code that’s slowing down, its the matrix refresh, so that’s what I’m trying to get figured out!