My game slows down and then closes after playing many levels in a row
Each level seems fine alone, but after a long session the phone gets hot and the game vanishes. Memory is not given back somewhere. This entry tells a real leak from the normal first jump, and estimates how many levels are left before the end.
Why this works
Memory always rises while things load, so one reading proves nothing. Reading at the same moment of each level and looking at the trend after the warm-up shows whether something is kept that should have been let go.
When not to use it
Skip it for the first minutes of a game, and for games that deliberately keep more as the player explores, such as a growing map; set a cap there instead.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- A diagram of every state
- 34 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "My game slows down and then closes after playing many levels in a row" (read_entry memory-grows-with-every-level-played) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP