Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Feedback Possible Bug in AudioClip Memory Reporting?

Discussion in 'Profiler Previews' started by kromenak, Apr 17, 2019.

  1. kromenak


    Feb 9, 2011
    So, this could either be a bug in how the Memory Profiler is working, or it could be a bug/limitation/known issue with AudioClips that the profiler is surfacing.

    I noticed that one of our AudioClips was appearing in the Memory Profiler with a much larger than expected size (exactly 1MB). It is not a big file, and the import settings show that it should be much smaller.

    I tried to reexport the file in different audio formats, changed the import settings, rename the file, etc. The profiler still reported it as taking up 1MB.

    As a test, I deleted the problem file and took another capture. In this case, it now showed *some other* audio file as being 1MB - one that had appeared as ~30KB before I deleted the problem file.

    So, I'm unsure why I always have one audio file that appears larger than it should feels like inaccurate reporting, but maybe something is going on that I'm not understanding.

    Below, I've attached a screenshot of the AudioClip section of the Memory Profiler and the import settings for the AudioClip that is listed as 1MB.

    AudioClips.png ImportSettings.png
  2. wkaj


    Unity Technologies

    May 18, 2012
    OK so technically what is happening here is that codec pool resources and other bits and pieces are allocated lazily on need. Unfortunately, when we load clips, we associate memory allocated during that load to the clip, which means that these resources get associated with one lucky clip.

    So the memory usage number is correct, it's just that it's associated with the wrong object (it should be associated with AudioManager or specific pooling stats).

    Will look into it and see if there is something we can do here.
    kromenak, Peter77 and MartinTilo like this.
  3. MDuwe


    Nov 20, 2017
    Hi, did you happen to have a solution for this problem? I've been on a wild goose chase trying to figure out what we did wrong before stumbling on this thread. I saw this happen for the same project on both Unity 2019 and 2021.
    Also repro'd it by having an empty project and dropping random sound effects into it, and building to device.

    Are there any other known reporting issues that people should be aware of? We're currently running quite close to the wire in terms of resources, so we're relying on the numbers we're seeing to make decisions.