Search Unity

Game crashing, can't figure out what is wrong from the profiler

Discussion in 'Editor & General Support' started by Smaika, Jul 19, 2020.

  1. Smaika

    Smaika

    Joined:
    Apr 28, 2014
    Posts:
    14
    I have a game made with Unity 2018.4
    The game keeps on crashing on one of the levels I added recently. I am unable to figure out what is causing the crash.
    I made a build of the game and ran the profiler in Unity until the game froze and crashed But I am unable to figure out what is wrong. I saved the profiler data and attached it (I ran the game twice so there are 2 data files). I hope this is enough to know why and what is causing the game to freeze and crash.
    Please help.
    Thanks

    File too large to attach please download the profiler data from here:
    https://drive.google.com/file/d/18Iavgr2DZxKhABG40-K3BQB1AISP9H01/view?usp=sharing
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,452
    Hi,

    Have you had a look at the Player Log files for hints? What Platform are you running this on? How much RAM is available on that Platform/Device?

    The only things I can tell you from that Profiler Data right now is:
    • your game is taking up nearly 6GB of Memory, mostly related to textures.
    • The Incremental GC is running every frame, while the Used Mono memory size keeps growing. Could be ok since you have enough time spend on vSync, could also hint at a problem where eventually the GC might not be able to ever clear out all the garbage in this way and will have to fall back to non-incremental collection. Not sure if that would pose a problem or be related to the one you have. If you are close to running out of memory, and this being some heap fragmentation issue on top, the Mono Reserved memory size could increase (can't see that happening in the data), and blow things out of the water?
    • Eitherway, you should probably check out AstarPath.Update(), specifically whatever happens in the scope of the ProfilerMarker named "Running Path Modifiers" because 5.5 KB garbage per frame is a bit much and likely avoidable, should make things faster too.
    • Similarly there is something under AIBase.Update() allocating 0.8KB every frame
    Giving those GC.Allocs some attention is always a good idea for performance, especially if they are of the easily avoidable category. You can turn on Allocation Call Stacks (in 2018.4 only available while profiling in the Editor) to get more details on what's causing this. That said. I have yet too little info to go on to say if this is even remotely related to the crash, so if eliminating those is complicated, ignore that route and look for more hints as to what happened in the logs, narrow down the situation in which it does, monitor system/task monitors and try to describe it in more detail here.