SpiderMonkey Garbage Collector

76 pointsposted 18 hours ago
by sebg

4 Comments

amelius

12 hours ago

How does it compare to concurrent GCs like the one in Go?

https://go.dev/doc/gc-guide

andrewl-hn

11 hours ago

From the list of features it is very similar / identical to JavaScript GC in V8 / Chrome, which honestly expected: browsers have been trying to one-up each other on benchmarks throughout all 2010s.

Go GC is incremental, concurrent, parallel, but it's not generational and not compacting. However, the way Go uses the memory internally is different from JavaScript, Java, C#, etc. Go data structures rely on pointers a lot less, and thus the process of inspecting the heap during garbage collection takes a lot less time, too. Many short-lived objects in Go remain on stack only, and do not need to be garbage-collected. So, their GC doesn't need to be as sophisticated as the ones in JVM, for example.

ape4

13 hours ago

Sounds very impressive. That "precise" feature is new to me.

i80and

10 hours ago

Most garbage collectors are precise, if possible.