Does increasing gc.setstepmul alone prevent memory exhaustion in Lua's incremental GC?
0 reputation · 26 Aug 2020, 05:31 UTC
Goal
Determine whether tuning only the step multiplier (gc.setstepmul) can keep the incremental garbage collector ahead of rapid table allocation bursts without adjusting the pause ratio (gc.setpause).
Constraints and uncertainty
The incremental collector interleaves marking and sweeping based on the pause ratio, which defines how much memory may accumulate before a new cycle starts, while the step multiplier controls the amount of work performed per incremental step. If allocation rate exceeds the combined effect of these two parameters, memory may grow unchecked, yet it is unclear whether raising the step multiplier alone compensates for a high pause value or if both must be adjusted together.
- What is the quantitative relationship between
gc.setstepmuland the effective reclamation rate whengc.setpauseremains at its default? - Can a sufficiently high step multiplier prevent memory exhaustion even if the pause ratio allows large memory growth between cycles?
- Does increasing the step multiplier introduce diminishing returns or additional CPU overhead that outweighs its benefit in high‑allocation scenarios?