Hi, I’m trying to fix repeated freezes (jerky camera) in my game, and while I use profile I don’t see any spikes or “weight” frames, but, instead, I see “holes” at every ten frames:
I am not sure what you mean by holes, but the dips or empty spaces I am assuming nothing is going on during those times as far as your CPU is concerned.
WaitForTargetFPS I believe is bottlenecked by your GPU and waits for the GPU to handle the graphical processing and is waiting for that to complete.
You appear to be leaking 1.6KB in a frame while the game is running, also your GUI.Repaint so some type of graphical stuff is leaking 4.4KB every frame. So in total it looks like you are leaking a good chunk of KB every frame. Now I am not sure what is causing your “stuttering” but I can safely assume some of your performance drop over time would be caused by the GC collecting the memory.
Yes, I mean dips )))
Hm, in total 6.0KB per frame… yes, it could be a performance drop over time. Thanks you, this is a good point to start.
I always thought, garbage collection is present in profile also…
So, it sounds like Unity doesn’t finish job in time and drop one frame? This could be a reason of freezes?
VSync is disabled. As I understand, WaitForTargetFPS is synchronization for target FPS, it “fills free time”, if I set targetFrameRate to 30 or 60 fps - I get different WaitForTargetFPS fills.
What is a mystery for me, is why Unity generates this empty spaces and is it normal or not )