Same issue is still happening to us. Memory usage goes up nearly 2mb from me respawning, walking and jumping around 3 times. I could replicate it in “Swarm Survival” and on a empty baseplate. On a empty baseplate the increments of each reset were smaller but still existed. About .5mb per reset.
This was produced by a server script repeatedly loading, playing animations, resetting the character and repeating.
Repro Code:
I ran this in the dev console command line twice (both AI generated):
task.spawn(function() local p=game.Players:GetPlayers()[1] local ids={"rbxassetid://913376220","rbxassetid://913402848","rbxassetid://507766388","rbxassetid://507766666","rbxassetid://507765000","rbxassetid://507767968","rbxassetid://507770239","rbxassetid://507770677","rbxassetid://507784897"} while p and p.Parent do local c=p.Character or p.CharacterAdded:Wait() local h=c:WaitForChild("Humanoid") local a=h:FindFirstChildOfClass("Animator") or Instance.new("Animator",h) local n=0 for i=1,200 do local anim=Instance.new("Animation") anim.AnimationId=ids[(i-1)%#ids+1] local ok,t=pcall(function() return a:LoadAnimation(anim) end) if ok and t then t:Play() n+=1 end end print(("[StressTest] %d/200 loaded, mem=%.1fMB"):format(n, game:GetService("Stats"):GetTotalMemoryUsageMb())) task.wait(2) p:LoadCharacter() p.CharacterAdded:Wait() task.wait(0.5) end end)
For a plain script under ServerScriptService:
-- StressTest_AnimationLeak (ServerScriptService)
local Players = game:GetService("Players")
local Stats = game:GetService("Stats")
local NUM_TRACKS = 200
local RESET_DELAY = 2
local ANIMATION_IDS = {
"rbxassetid://913376220", -- walk
"rbxassetid://913402848", -- run
"rbxassetid://507766388", -- idle 1
"rbxassetid://507766666", -- idle 2
"rbxassetid://507765000", -- jump
"rbxassetid://507767968", -- fall
"rbxassetid://507770239", -- climb
"rbxassetid://507770677", -- swim idle
"rbxassetid://507784897", -- swim
}
local function loadAndPlay(character)
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", humanoid)
local loaded = 0
for i = 1, NUM_TRACKS do
local id = ANIMATION_IDS[(i - 1) % #ANIMATION_IDS + 1]
local anim = Instance.new("Animation")
anim.AnimationId = id
local ok, track = pcall(function()
return animator:LoadAnimation(anim)
end)
if ok and track then
track:Play()
loaded += 1
end
end
print(("[StressTest] Loaded %d/%d tracks on %s (mem: %.1f MB)")
:format(loaded, NUM_TRACKS, character.Name, Stats:GetTotalMemoryUsageMb()))
end
local function runLoop(player)
while player and player.Parent do
local character = player.Character or player.CharacterAdded:Wait()
loadAndPlay(character)
task.wait(RESET_DELAY)
player:LoadCharacter()
player.CharacterAdded:Wait()
task.wait(0.5)
end
end
-- Grab the first player currently in the game
local firstPlayer = Players:GetPlayers()[1]
if firstPlayer then
task.spawn(runLoop, firstPlayer)
else
-- If script runs before anyone's joined, wait for the first one
local conn
conn = Players.PlayerAdded:Connect(function(player)
conn:Disconnect()
task.spawn(runLoop, player)
end)
end