Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Bug Memory Profiler: Snapshots take too much memory

Discussion in 'Profiler Previews' started by tessellation, Feb 4, 2022.

  1. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    399
    It's very useful to be able to capture Editor memory usage and find leaks that only occur in the tool. When doing this, we're seeing a lot of memory being used by the Memory Profiler itself when it captures Snapshot screenshots. When you have a lot of captured memory profiles, these can take up a lot of memory. Since they are only used as thumbnails, couldn't you scale these down in size (ideally take a bilinear/Mitchell mip-map that's smooth, not nearest neighbor) and maybe DXT compress them using Texture2D.Compress()? There's no reason these should be taking up a gigabyte of RAM in the editor.
     
    MartinTilo likes this.
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,517
    Hello :)

    We've actually just reduced the screenshot size in memory with 5.0, if only just a little, but you're right that they can be reduced more and we're looking into that.

    Are you per chance using a 4K monitor though? I couldn't reproduce screenshots that unreasonably big without one, which is probably how I didn't notice how bad it got...

    btw, you can take snapshots without taking screenshots as a stop gap solution until we ship a fix:
    Unity_6E7aAxHcxw.png
     
  3. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    399
    Thanks for the reply! Yes I'm running the editor on a 4K monitor, but most of my captures are from a Google Pixel XL and only a handful of ones from the editor. Most of them were taken with version 0.4.4. For the editor, the Game view isn't that large, though, so I haven't tested if it's using the Game View resolution or the 4K screen's resolution.

    Thanks for the work-around and I'm glad to hear that you're working on reducing them.