There’s a critical memory leak occurring in our game, Kaizen, Which primarily impacts long play sessions and makes the game almost unplayable on Consoles due to out-of-memory crashes.
The issue:
Upon teleporting between places (ex: Main Game → Raid Lobby), There is a chance for the CoreMemory/gui/freeType memory tag to fail to garbage collect. Instead of clearing, it accumulates massive amounts of memory, observed reaching as high as 12.9GB on PC
On Console platforms, this results in a crash after approximately 40 minutes of gameplay as the shared memory limit is reached.
Notes:
I am aware of similar reports linking FreeType to UIStroke.ScaledSize However, Kaizen does not use the ScaledSize feature of UIStroke
System Information:
CPU: AMD Ryzen 8400F
GPU: NVIDIA RTX 5060
RAM: 32GB DDR5
OS: Windows 11 Note: While I have 32GB RAM to sustain the memory leak, this crashes average users and consoles immediately.
Open the Developer Console and navigate to the Memory tab
Trigger a teleport to another place (Enter Raids or AFK)
Observe the CoreMemory/gui/freeType tag
Repeat the teleportation steps if necessary (it happen randomly)
Observed result: The freeType memory usage spikes into the Gigabytes and does not go down.
Expected behavior
When teleporting between places, the CoreMemory/gui/freeType memory should be flushed or garbage collected. Memory usage should return to normal for Console users and lower-end PCs
Hi!! I solved this issue in another game yesterday, the problem stemmed from the game having unoptimized UI in the leaderboards & having UI strokes everywhere in them, I found that looking directly at the surfacegui would spike memory usage:
I also noticed that in your game as well as the other game I was doing research on yesterday had not had the roblox garbage collected when teleporting or even leaving the game & switching to another game instance:
I did a few benchmarks & found that the leaderboards were just so unoptimized, they had UI strokes everywhere in every text label, every time you looked directly at them the memory would spike, the dev after telling her about this had brought the 50 templates being displayed in the leaderboard down to 32 for each leaderboard, which had reduced this heavily & stopped the leak, resources were still high though but the actual endless spike stopped, nevertheless she will roll out a patch soon in her game to give more lightweight leaderboards & optimized since uistrokes cause so much bloat
We’ve not been able to reproduce this on our end. However, we did fix a potentially related issue with a small memory leak in font rendering. This feature was just rolled out to desktop clients today.
If you’re able to somewhat reliably reproduce the issue, you could re-test and see if it still happens?
Quick note: A majority of the crashes that are happening are on Playstation
While xbox seems to be fine, Playstation is crashing at a 20-30% rate (compared to xbox at 2%)
It’s impacting the game a lot
Even mobile players are able to run the game relatively fine compared to Playstation players