Massive Memory Leak in CoreMemory/gui/Freetype upon Teleporting (Up to 13GB+)

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

Visual Aids:


Direct Links:
Experience Link: [🔥 MAKI RAID] KAIZEN - Roblox
Start Place ID: 17662297954

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.

Reproduction Steps:

  1. Launch the Roblox Client and enter Kaizen
  2. Open the Developer Console and navigate to the Memory tab
  3. Trigger a teleport to another place (Enter Raids or AFK)
  4. Observe the CoreMemory/gui/freeType tag
  5. Repeat the teleportation steps if necessary (it happen randomly)
  6. 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

A private message is associated with this bug report

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:


here is a collection/combination of games that I joined, this is said Kaizen game


& here is a completely different universe, very odd & should definitely clear it

Yeah, Not sure how to fix this.
It’s impacting a lot of our player base on Console and Mobile and hurting our game

How did you fix your problem with the UIStrokes? Maybe this is something similar?

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

Hi @BerrySus thank you for the report. We are investigating to see if we can reproduce the issue and will follow up with our findings!

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?

Has this feature been rolled out for all console players?
The console crash rate has not changed

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

No it hasn’t been rolled out to console, studio only at this time.

The flag has rolled out to all platforms.

@BerrySus were you able to confirm if the issue is fixed for you? We were not able to reproduce it on our end, so we are just making an educated guess

Yes, The issue seems to have been fixed since crash rates have dropped significantly the day the flag rolled to all platforms

Woohoo! Sorry for the trouble on this one, and thank you for confirming for me.