Search Unity

Expected times for capturing and processing snapshots?

Discussion in 'Profiler Previews' started by pavelkouril, Dec 19, 2018.

  1. pavelkouril

    pavelkouril

    Joined:
    Jul 22, 2016
    Posts:
    125
    Hello,

    I'm trying to capture a snapshot of a running game (reports around 2.2GB in task manager), and the snapshot takes forever (approximately 30 minutes) to capture and then to load (around ~15 minutes). Also, the snapshots take like 10GB on disk, and the snapshot contains around 1 million of objects (~750k managed and 250k native ones).

    Do you consider this as an expected/reasonable time for the memory profiler workflows, or is this something that you intend to work on in the future and make it considerably faster?
     
  2. Greg_Wojciechowski

    Greg_Wojciechowski

    Unity Technologies

    Joined:
    Feb 8, 2017
    Posts:
    7
    Hello pavelkouril.

    Speed of memory profiling is one of really important topics for us. Could you open ticket for us and attach there your compressed snapshot ? We would use it for investigation why it took so long to open, try improve code to handle it better and investigate why it taking so much on your hard drive.
     
  3. pavelkouril

    pavelkouril

    Joined:
    Jul 22, 2016
    Posts:
    125
    Hello, done.

    Reported it as a Case 1111451.
     
  4. MartinV

    MartinV

    Joined:
    Nov 12, 2013
    Posts:
    3
    I have similar issue. Capture took about 30 minutes. This was in Editor while game was running, and so I assume capturing on device could be faster due to Editor contributing a lot of allocations. But as I'm not able to run on device (separate ticket, linker crash when building Android), that's all I have at the moment.
    The larger issue is that when I then Open the capture, Unity crashes about 5 minutes into opening it. I've uploaded compressed capture in the ticket (500MB uncompressed size). Case 1111647
     
  5. samfisher-ace

    samfisher-ace

    Joined:
    Jun 13, 2016
    Posts:
    4
    The latest memory profiler preview 4 contains a fix for a stack overflow crash, which I have also noticed and fixed locally before their fix came out.

    My snapshots also take between 15-45 mins to open and diff, so I added a progress bar tracking the number of objects processed to know if the profiler is still doing something or has just frozen/hung due to some error.
     
  6. ScottyB

    ScottyB

    Joined:
    Apr 4, 2011
    Posts:
    133
    Hi @Greg_Wojciechowski, I recently submitted a new bug report (Case 1126009) where the memory snapshot crawling process either gets stuck or takes an unreasonably long time (I waiting 30 mins+ before force closing Unity). Just thought you would like to know in case it helps fixing and/or speeding up the snapshot crawling code.
     
    MartinTilo likes this.
  7. Rohansi

    Rohansi

    Joined:
    Jun 14, 2017
    Posts:
    3
    I just submitted two bug reports related to this (1142394 and 1142384) with solutions included. The first one is when capturing a snapshot it will take a long time (depending on size) to actually start dumping the snapshot, and the fix is a patch to Unity's fork of Mono. The second one is an optimization to the memory profiler package to speed up one of the last steps in opening the snapshots.

    The second issue may be better solved by introducing a processing phase after capturing snapshots so it can be cleaned up and sorted for quick access.
     
    MartinTilo likes this.
  8. Rohansi

    Rohansi

    Joined:
    Jun 14, 2017
    Posts:
    3
    Just submitted another two for processing snapshots, one for performance (1146248) and one integer overflow (1146246). This one helps with the loading when you see the progress bar at "Crawling GC handles". My solutions are included with them as well. With all my fixes I got a snapshot that's 117 GB large and took like 18 hours to capture, loading it didn't take an unreasonable amount of time though.
     
    Last edited: Apr 15, 2019
    MartinTilo likes this.
  9. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    2,219
    They take about 30 seconds to 1 minute to capture, and a 2-3 seconds to open for us. This is on a relatively large client project for HoloLens.
     
unityunity