In every game on Roblox whenever your own character dies the client leaks some amount of instances and memory. This amount starts at high, and decreases which implies that a large part of it is actually just deferred reclaimed memory, but still consistently increases after 20 minutes and 500+ deaths.
- Occurs with R15 (see my avatar), but reproduces with anyone’s avatar, including custom avatars
- Occurs on both memory constrained and un-memory-constrained platforms
- Occurs consistently
- Occurs for other players characters too, although them leaving appears to clean up some memory usage (hard to tell, too much noise)
The fact that your character dying can lead to memory leaking is a significant issue.
Fixing this bug is important because this leads to crashes on many low-end devices in games with a lot of deaths
Note that the game client reports less memory used than the stats, but still more memory usage
Reproduction steps
- Play a game (empty baseplate works)
- Reset your character
You can test the results here in this open source game: Die every second - Roblox
Expected Behavior
I expect death to never memory leak. Instead, we see a consistent but slow rise in both instance count, and memory usage. This is very problematic as it leads to low-end mobile clients crashing after extended gameplay as memory is never reclaimed.
- Dying may temporary raise memory usage but…
- Dying should never lead to permanent memory being lost for use later
Note that tracking here is actually wrong too. Windows shows Roblox consuming 616 MB of memory, while the in-game client reports consuming 805 MB of memory. However, the windows memory usage is also slowly increasing.
Actual Behavior
What actually happens is memory usage increases permanently over a long period of time.
Additionally, if multiple players are playing the game, then everytime they die, the system also appears to leak instance count and memory usage. This is very problematic.
Workaround
Not killing the character appears to solve some of this.
Issue Area: Engine
Issue Type: Crashing
Impact: High
Frequency: Constantly