Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Memory Profiler: steady increase in untracked memory over first minute after launch

Discussion in 'Profiler Previews' started by jperry_oddgames, Feb 10, 2022.

  1. jperry_oddgames

    jperry_oddgames

    Joined:
    Sep 18, 2017
    Posts:
    62
    Hi,

    I noticed the 'untracked memory' category will increase steadily over the first minute or so after launching a build. This occurs in a brand new blank project and is reproducible every time.

    I've reported a bug, case#: 1402028

    I realize this may not technically be a bug in the memory profiler package but rather a strange issue with how Unity is allocating some crucial startup memory, etc. However, it seems odd to me that it's showing under the untracked category.

    If Unity staff is aware of this increase, can we please get some info on what exactly is causing it and whether it can be mitigated with particular settings?

    Thanks
     
    shaileshombpm and alexeyzakharov like this.
  2. alexeyzakharov

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    507
  3. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,432
    Are you experiencing this by taking several snapshots in a row during that time? Is this a build utilizing the IL2CPP Scripting back-end? If so this could just be down to Type Metadata inflation that happens when taking snapshots and is not a big, but par-for the course. This usually tapers off after the first few snapshots

    Getting IL2CPP Virtual Machine memory out of "Untracked" land is on our radar though.
     
  4. jperry_oddgames

    jperry_oddgames

    Joined:
    Sep 18, 2017
    Posts:
    62
    Thanks for the quick replies

    Sorry, I should've included more details in the original report. To clarify, this occurs on both Mono & IL2CPP builds. I'm using
    Unity 2020.3.26f1
    and
    Memory Profiler 0.5.0-preview.1
    .

    Before discovering this rise-over-time issue, we were trying to diagnose which plugins were contributing to untracked memory the most in our game by taking snapshots on different builds that had plugins stripped and comparing the results. Unfortunately the seemingly random noise in the results made the data quite unreliable (we could take a snapshot in the same build multiple times across multiple launches and get wildly different results).

    I've included a screenshot of some graphs below that show the results of 'untracked memory' at different intervals on both Mono & IL2CPP builds.
    The first series (blue line) shows results taken immediately after app startup, then at 20 second intervals for 4 minutes.
    The second & third series show data at 40 & 60 second intervals respectively and their first snapshot was delayed.

    The data seems to suggest that the memory snapshots themselves are likely responsible for the untracked memory as the value doesn't seem to rise until the first snapshot is taken.
    I guess my main issue at this point is I feel this should be more clear. I would expect a blank project with no plugins to show zero untracked memory, and any memory generated by the profiling tool itself would be marked explicitly.

    I hope this data can help somehow, thanks
     

    Attached Files: