Profiler: Why are these random performance spikes happening? How can I fix them?

I have been using profiler to optimize my game.
My game basically runs very smoothly but sometimes there are some strange spike happening.
The profiler doesn’t point to my script, it points to some unity stuff that I don’t really understand.
Why are these random performance spikes happening? How can I fix them?





This kind of stuff can be caused by the editor. It shouldn’t be a problem in a build.

Actually I am looking for the reason that causes the occasional short lag in build. But all I can see are random spikes like these.
I want to use deep profiler but the game would be so slow that it is unplayable.

You should profile the build! Have a look here.

I tried it.
The deep profiler is still unusable when I profile the build.
It causes major lag.
Can’t tell which spike is not caused by profiling.

8800822--1196773--000036.png
8800822--1196776--000037.png
8800822--1196779--000039.png
8800822--1196782--000040.png
8800822--1196785--000041.png

I turned off the deep profiler.
I see that there is a wait for target fps issue.

8800912--1196821--000044.png
8800912--1196824--000043.png