Having a GUI with ResetOnSpawn enabled placed in StarterGui will cause memory under “Gui” to keep raising each time the character is respawned and will not lower.
Here is a quick alternative to getting around this that I did: I put the GUI in a folder in ReplicatedStorage, and cloned it into PlayerGui with a local script on each Player.CharacterAdded (place in StarterPlayerScripts).
Code
local plr = game.Players.LocalPlayer
plr.CharacterAdded:Connect(function()
for _,v in pairs(game.ReplicatedStorage.Folder:GetChildren()) do
v:Clone().Parent = plr.PlayerGui
end
end)
This was the result I got, which shows that the original problem is most definitely caused by StarterGui and how it handles the ResetOnSpawn:
Repro: ResetOnSpawn Memory Leak.rbxl (29.9 KB)