Search Unity

Understanding memory profiler: System.Byte[] ?

Discussion in 'Profiler Previews' started by Jelmer123, Mar 15, 2021.

  1. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    180
    Hi

    I've got a relatively large System.Byte[] section in the memory profiler result. It is 230MB, approx 50% of all memory used by my app.
    How can one find out what it is?
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,556
    Looking at the content byte by byte is likely going to be tough to parse. It still being in memory means there's a likely chance something still holds a reference to it. If that's the case the Ref Count column should hold a blue number. Clicking on that would show you a list of Objects that reference it (each with a Ref Count of their own). Following that trail is likely to be your best chance of figuring out what's up with that byte array.

    You could also search your codebase for
    byte[
    or similar but it might be a return value stored in a var, so... that might lead nowhere.
     
unityunity