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. The 2023.1 beta is now available for testing. To find out what's new, have a look at our 2023.1 feature highlights.
    Dismiss Notice

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

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

  1. jperryoddgames

    jperryoddgames

    Joined:
    Sep 18, 2017
    Posts:
    45
    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

    Unity Technologies

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

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,910
    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. jperryoddgames

    jperryoddgames

    Joined:
    Sep 18, 2017
    Posts:
    45
    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: