When you mean variables get reset, does that affect what’s on screen.
The key online is to avoid setting something on frames where it hasn’t actually changed.
This thread may also help. PsychoJS platform version 2020.1 - Memory Leak in Visual Stimulus Setters