Performance peaks in ScriptRunBehaviourUpdate
Hey guys,
i have a short question, maybe you can help me and give ma some advice. In my unity-Project I have a view scripts using the Update()-Method. The common peakSize of those scripts in the Profiliers CPU-Usage row is about 130 FPS high. Anyways, evey 200 frames (round about) there are large Peaks in the visualisation with a heigth of more than 15 FPS. Those Peaks are always caused by another Scripts Method and last for only one frame. Sometimes those Scripts repeat this behaviour. Are there some special tips you can give me to prevent my Project from having those Performance lows? Which codeelements cause those peaks usually?
Thanks in advance!
Best regards Johannes
By the way, I have to use unity 17.3 for my project. $$anonymous$$aybe this info is important too..
Answer by lodendsg · Dec 02, 2019 at 12:43 PM
Without seeing the graph I can only guess but periodic spikes are offten the cause of GC (Garbage Collector) to prevent/reduce them avoid/reduce GC allocations. As I recall there is a column in the tool to see GC allocations per frame aim to bring that to zero.
I am only guessing that your spikes are GC of course