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

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:
    347
    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:
    1,896
    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:
    347
    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.