I’ve just been working on a 300 line MicroPython graphics program and have been getting disturbance along the bottom edge of the screen and at times Thonny has lost connection with my Window 10 PC and the Pico - COM 3 error and loads of red warnings in the REPL window.
On re-powering the Pico and pressing STOP icon on Thonny I was able to re-run the program a few times before it happened again.
I fear that the garbage collect routines are not working very well so I added
near the top of the program, under the boilerplate, and got just 668 as the answer.
I’m obviously near the limit!
Probably worth checking if you get similar problems.