| ▲ | gamarino 4 days ago | |
It is a non-moving GC. The short pauses are a direct consequence of the immutable-by-default model. Once we collect the roots from thread stacks and global data during a brief Stop-The-World (STW) phase, those objects will not be modified by user threads. This allows the GC thread to perform the marking and sweeping phases in parallel with application threads without needing complex write barriers or locks. Regarding mutability and cycles: All mutable objects are managed through a centralized structure whose root is scanned during the STW phase. Even this internal tracking structure uses immutable tree patterns, ensuring that once the GC starts its parallel phase, the pointers it is traversing remain stable. Cycles are indeed possible in the object model, and the Mark-and-Sweep algorithm handles them naturally, ensuring that big systems with complex interactions don't leak memory. The goal was to eliminate the standard synchronization overhead (locks/barriers) by leveraging the fact that 99% of the object graph is immutable and hardware-aligned. | ||