How to switch screens correctly?

This can significantly increase the number of switches, but eventually it will crash, and there is no problem with the memory monitoring display.