PlaceMemory:Animation Memory Leak

I’m getting major memory leaks on some of my game’s servers. Caused by animation buildup? My game doesn’t play any animations, only what the player has equipped. I get this warning on the client 400k times the past 24 hours:
Failed to play animation. AnimationTrack limit of 64 tracks exceeded, new animations will not be played. http://www.roblox.com/asset/?id=10921261968,
http://www.roblox.com/asset/?id=10921269718,
http://www.roblox.com/asset/?id=11600205519,SelfAvatar
http://www.roblox.com/asset/?id=11600206437,SelfAvatar
http://www.roblox.com/asset/?id=18747062535,SelfAvatar
http://www.roblox.com/asset/?id=507765000,
http://www.roblox.com/asset/?id=507766388,

In the same version of the game, I had one server that had been running for over 97 hours and with nothing wrong:

And another was running for 27 hours and looked like this:

A private message is associated with this bug report

7 Likes

I can confirm I’ve had similar issues in my game. Just like OP, in a server running for ~24 hours, you can observe elevated “Animation”, “BaseParts”, and “Instances” memory usages.

1 Like

This is the workaround that I can confirm works:

Players.PlayerAdded:Connect(function(player)
	player.CharacterRemoving:Connect(function(character)
		character:Destroy()
	end)
end)
3 Likes

That’s odd… I thought the default behavior of Workspace.PlayerCharacterDestroyBehavior was to destroy characters already. In any case, there shouldn’t be any reason why this issue started happening now. Likely something on Roblox’s end.

Thanks for the help.

I’ve also encountered the same animation memory overflow issue, which seems to have started around July 16th. I didn’t have this problem before. How can I fix it?

Not the same category, but also an issue of growing server memory usage as server lifetime increases. The notable categories are System, CoreMemory:Total and System, PlaceMemory:Gui I’m not sure for how long this issue has been here because I really wasn’t paying enough attention to it until the past few days, but I’ve been working through my code. While I was originally finding some real leaks, I’ve hit a dead end. I can’t find anything else.

I joined this server with high memory usage to take a look, and have done so with many servers the past few days.

LuauHeap doesn’t reveal really any UI objects, which is confusing because I supposedly have a lot of GuiMemory in use.

There’s also only 31.8MB of data being taken up by LuauHeap, so this obviously isn’t the direction to look. I took a look at many existing objects across all areas of the game using a script, and everything reported back normal. There was nothing getting out of hand or any lingering objects. So I’m not holding references to things that need to go in scripts, but they’re also not in the DataModel, which as far as I know means they should be garbage collected.

image
image
image
image
image

CoreMemory and PlaceMemory are clearly the categories suffering from memory use, which is expected after seeing the graph. Somehow UntrackedMemory is actually negative?

image

According to the documentation, CoreMemory is not something I have control over. Yet it’s growing in size, which is disheartening because I would really like to get ahead of this memory leak and fix it. For the sake of reporting though, I’ll post the two worst subcategories of CoreMemory.

image
image

Besides those two, the rest of them aren’t really noteworthy. They are all just small pieces making up the rest of the memory usage. But then we can look at PlaceMemory, because the documentation says I do have control over that.

image

This is pretty much the entire memory usage. The next highest is Instances, which is only at 202 MB. But why would Gui take up so much memory? I already audited all GUI objects in this live server. There are no Player objects or PlayerGui left leaking in memory. There are no GUI objects themselves leaking. And when auditing the amount of GUI objects in the game, it’s all normal amounts that I expect. Yet this memory just grows and grows, despite my GUI count in the place not actually growing with it.

So what’s going on? Do I actually have control over it like the documentation says, or is there a leak in PlaceMemory that I can’t control? I really hope this can be addressed soon.

Edit: I actually do have the reported animation memory bug here, but it’s not as noticeable in my case as player deaths are not common.

1 Like

I hope they will expedite this fix. I have this problem in my game too that has high character respawns and causing high outofmemory crashes. no intervention fixes it such as destroybehavior etc. constantly just increases on the mem on every respawn

I’m having similar issues.
Animation, Gui, BaseParts, and instances are taking up a large amount of memory.

When looking at “Out Of Memory” crashes, you can see the top source is players and their Gui:

And when looking at server memory usage its all the same:


I noticed a server fps issue which I believe is related to animations here, but not sure it relates

I began to think the issue may be on my end due to a script because of the lack of Gui memory leak reports. However, I did more searching and discovered that the leak still occured with 0 scripts in the game whatsoever. Upon doing further searching, simply cloning all a player’s Guis, parenting the clones to their PlayerGui, and calling :Destroy() on them still caused the leak. But I also know this leak didn’t occur in another game, and I discovered that the leak is happening only on Guis with a StyleLink. It doesn’t matter if that StyleLink is connected to a StyleSheet or not. Just its existence is enough to make it leak from my testing.

I’m not actually sure if this is caused by the same bug this thread is reporting, so I’m uncertain if I need to file a separate bug report or just leave the details here. I do have a file which reproduces the leak I can send in a private message if needed.