Even on a C++ server, if quests, AI, and skills run in a scripting language such as Lua, the zone stops while the script engine’s GC runs.
Why Each zone’s script engine creates large numbers of temporary objects while running quests, AI, and events → Effect When the script engine’s GC collects a lot at once, that zone’s tick stops → On screen Periodic hitches only in certain zones or during certain events
Configure incremental or generational GC, advance GC a little every tick, reduce temporary objects in scripts.
Ballpark numbers
Once a script heap grows to hundreds of MB, an all-at-once collection (with incremental collection turned off, or a full collection in generational mode) can take tens to hundreds of milliseconds.
On the graph
Periodic spikes · Tick time per zone, script engine memory
Where to look
Record each zone’s tick time and the memory use of that zone’s script engine (collectgarbage("count") in Lua) every tick and overlay them on one graph
Confirmed if
The moments script memory drops sharply (an all-at-once collection) line up with that zone’s tick spikes, while other zones are fine
Ruled out if
Spikes with no change in script memory: that zone’s load or locks. Every zone on the server spikes at once: server GC (mem-gc) or swap (mem-swap)
Check with
Game server or client logs and metrics
Sources
Lua 5.4 Reference ManualLua.org Incremental mode splits collection into small steps interleaved with execution (large steps make it stop-the-world); a major collection in generational mode is a stop-the-world pass over every object; collectgarbage("count") returns the total memory Lua is using (KB)