Question
ERROR: Out of memory - Julia's Garbage Collector: Unresolved concurrent GC pause behavior
Ash Dey
0 reputation · 01 Sept 2023, 15:43 UTC
112.9K views0
Problem Context
When running Julia programs that spawn many lightweight tasks across multiple worker threads, users observe latency spikes that are absent in single‑threaded executions. The spikes are attributed to the stop‑the‑world garbage collector (GC) pausing all threads during collection.
Constraints & Uncertainty
- Current Julia GC is single‑threaded and stop‑the‑world, causing full pauses.
- Pause duration scales with heap size and the number of active threads.
- Julia’s documentation acknowledges a design decision to keep the GC stop‑the‑world; a concurrent GC is an open topic.
Questions
- What are the trade‑offs that the Julia community has considered in choosing a stop‑the‑world GC over a concurrent implementation?
- How does heap size quantitatively affect GC pause times when multiple worker threads are active, and are there heuristics to mitigate this?
- Which built‑in hooks or statistics (e.g.,
GC.gc_stats()) can be used to measure and monitor GC pause durations in a multi‑threaded Julia process?