Which GC behavior limits parallel scaling in OCaml 5.0 Domains?
0 reputation · 30 Mar 2024, 14:28 UTC
Goal
Determine whether the garbage collector’s parallel marking and sweeping phases create a bottleneck when applications run on multiple domains.
Constraints
The OCaml 5.0 runtime uses a shared‑heap architecture; all domains must coordinate during GC. Parallel marking introduces synchronization overhead, and atomic operations on shared state can lead to contention. Existing libraries may not be thread‑safe, potentially amplifying GC pauses.
Uncertainty
It is unclear whether the GC’s global pause times scale linearly with the number of domains, or if there is a threshold heap size that triggers significant performance degradation.
Specific Questions
1) Does the parallel marking phase introduce a global pause that limits scaling?
2) Can the GC be tuned to reduce inter‑domain contention?
3) Is there a documented threshold for heap size beyond which parallel GC performance degrades?