The Problem: The Mysterious 2-Second Freeze
Imagine your Go microservice is a chef in a busy kitchen. It processes orders (JSON payloads) super fast. Life is good, until every 15 minutes, the chef completely freezes for 2 seconds. Orders pile up.
Why did the chef freeze? The Trash.
When you parse JSON using the standard encoding/json library, you create a lot of garbage (heap allocations). Go has a Garbage Collector (GC) that acts like a janitor.
If the chef makes trash faster than the janitor can sweep it, the Go runtime triggers Mark Assist. The runtime literally hands the chef a broom and forces them to sweep instead of cooking. The chef isn't frozen; the chef is doing janitor work.






