Garbage Collection
In minigames, every Canvas or Image object in JavaScript has an actual texture storage at the Client layer. This actual texture storage holds the real texture of the Canvas or Image, which usually takes up a considerable amount of memory.
The recycling timing of each Client-side actual texture storage depends on the recycling of the Canvas and Image objects in JavaScript. Before the Canvas and Image objects in JavaScript are recycled, the corresponding actual texture storage on the Client will not be recycled. By calling sud.triggerGC(), you can speed up triggering the JavaScriptCore Garbage Collection, thereby triggering the recycling of Canvas and Image objects that are no longer referenced in JavaScript and releasing the corresponding actual texture storage.
However, the exact timing of when GC is triggered still depends on the JavaScriptCore mechanism itself. There is no guarantee that calling sud.triggerGC() will trigger recycling immediately. It is recommended to trigger it at the start or end of each game round.
