Quick answer: Turn on the Profiler's GC Alloc tracking and Allocation Callstacks, sort by GC Alloc to find the allocating method, and replace the allocation with cached buffers, structs, or non-allocating APIs.
Steady frame rate punctuated by regular hitches is the signature of garbage collection. The fix is not to call GC less; it is to allocate nothing in your hot path so there is nothing to collect. The Profiler tells you exactly where the bytes come from.
How to find and remove it
1. Sort by GC Alloc, not time
In the Profiler CPU Hierarchy, sort by the GC Alloc column. Any nonzero allocation that repeats every frame is a leak of garbage you can eliminate, regardless of how cheap it looks in milliseconds.
2. Enable Allocation Callstacks
Turn on Call Stacks for GC.Alloc in the Profiler so each allocation row shows the exact line that created it. This skips the guessing about which of three suspects actually allocates.
3. Replace the usual offenders
Cache WaitForSeconds, avoid LINQ in Update, use StringBuilder or preformatted strings, and pass structs to avoid boxing. Each removes a recurring allocation rather than deferring it.
4. Verify with a clean recording
Re-record and confirm the GC Alloc column reads 0 B on your hot methods. A frame with zero managed allocation never triggers a collection, so the hitch is gone, not just smaller.
Catching the ones you can't reproduce
The hardest version of this to fix is the one you can't reproduce — it only happens on a player's hardware, OS, driver, or save state, under conditions that simply aren't present on your machine. A report that says “it crashed” or “it froze” gives you nothing to act on, so the bug survives release after release while quietly costing you players.
Automatic error capture closes that gap. Each failure arrives with its full stack trace, the device and OS, the build number, and a breadcrumb trail of what the player did right before it broke, so even a failure you have never seen becomes a specific, reproducible issue. Fold identical failures into one signature ranked by how many players each hits, and your worklist sorts itself worst-first instead of arriving as a stream of vague complaints.
This is where a tool like Bugnet earns its place. Its SDK captures every Unity error automatically with the full stack trace plus device, OS, memory, build, and game-state context, folds duplicates into one grouped issue with an occurrence count, and ties each to the build it first appeared on — so you fix the problem that hurts the most players first and confirm it is gone when its signature disappears from the next release.
The errors you never hear about are the ones quietly costing you players. Visibility turns them into a worklist.