I read several other threads that described a similar problem. The memory leak seems to have something to do with character models being cached but the cache is never purged. Someone suggested adding this code to the server to help fend off the memory leak:
local playerService = game:GetService("Players")
playerService.PlayerRemoving:Connect(function(player)
if player.Character ~= nil then
player.Character:Destroy()
end
end)
That supposedly forces the engine to destroy the character and purges the character appearance from the cache. Several individuals have said that it helps.
This bug report has been open for nearly two years - at this point Iāve just accepted my game canāt be fixed as this is totally undiagnosable and absolutely destroying my userbase and retention. Iām not sure what I can do to fix it anymore.
This error ended up being caused by our datastore system. We were using a folder heirarchy - when a player joined, we would clone the folder structure, fill it with values, and make it accessible to the client via replicatedstorage.
Donāt use this method. We removed it (switching to a table structure stored on the server, made accessible to clients via remotes), and the issues vanished.
Im sure its been a very long while since you even thought about this problem, but are there any other workarounds? My game uses the same system, and recoding the entire game to fix this issue would be a massive painā¦
Attached is what my data structure is