Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Memory being used up by Animation Clips?

Discussion in 'Windows' started by Rajmahal, Aug 21, 2014.

  1. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I'm profiling my game and I'm noticing an insane amount of memory being used for animation clips ... around 107 MB. I didn't have this issue with my previous game. Exactly how can I reduce this? I'm using Legacy Animation in my models and some of the models do have a lot of clips that I"m not using. Is it enough to just remove these from the list of Animations of the prefab or do I have to go into the original model and delete the animations completely? Is there someway to compress or reduce the runtime memory consumption used by animation clips?
     
  2. pierrepaul

    pierrepaul

    Unity Technologies

    Joined:
    Jun 19, 2012
    Posts:
    162
    Hi.

    Removing the Animation from the AnimationComponent list will free memory at runtime. You don't need to remove them from the project or the fbx.

    As for making them smaller, we have added an Optimal compression mode that should make them smaller (if possible). But its only available for non-Legacy clip. We have no plans on bringing that to Legacy.

    Why are you not using Mecanim ?
     
  3. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Thanks ... unfortunately, the game kit I'm using uses Legacy animations as do many of the assets I'm using.
     
  4. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I noticed that several of the animations taking up the most memory didn't have keyframe animation compression enabled. Enabling it seems to make a big difference. Are the standard settings for rotation, position and scaling error of 0.5 reasonable or is there benefit to increasing this to further compress animation data? Would it be silly to increase this to 10 or something for mobile devices?
     
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    10,960
    10 would probably be silly, yes. But in general, compress them as much as you want, as long as you still like the output. (for example, with compression, feet start sliding a bit, depending on the animation it might be noticeable or not).