Animation.AddClip() copies the clip?

I just want to confirm if this is Unity, or something I’m doing. I have an object that acts as an animation library and when characters are loaded into the scene they fill out their Animation components by using .AddClip and sourcing from the library. Whenever a clip is added it appears to be duplicated in memory. Is this normal behavior for Unity or am I leaking something somewhere?

Thanks!

This is a really late reply, but I found the issue!

I have multiple animations and 3 different rigs, so I decided to rename all the animation clips when adding them to the Animation class. (This is using legacy Animation, not Mecanim)

So for instance

Spider_Idle
Raptor_Idle

Became just “Idle” in the Animation.

AnimationClip animClip = animationContainer.AnimationClip;
string name = animClip.name.Substring(animClip.name.IndexOf('_') + 1);

animation.AddClip(name , animClip);

If name != anim.Clip.name, you will get duplicated animations in memory, every time you AddClip.

So, the solution that fixed our problem was dynamically renaming the animation clip

AnimationClip animClip = animationContainer.AnimationClip;
animClip.name = animClip.name.Substring(animClip.name.IndexOf('_') + 1);

animation.AddClip(animClip.name, animationContainer.AnimationClip);

Hope this helps anyone with this issue. I’m reporting it as a bug to Unity.