Search Unity

Feedback Possible Bug in AudioClip Memory Reporting?

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

  1. kromenak

    kromenak

    Joined:
    Feb 9, 2011
    Posts:
    261
    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 be...it 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

    wkaj

    Unity Technologies

    Joined:
    May 18, 2012
    Posts:
    50
    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.
unityunity