What kind of Garbage Collection does Go use?

后端 未结 5 2051
余生分开走
余生分开走 2020-12-02 04:58

Go is a garbage collected language:

http://golang.org/doc/go_faq.html#garbage_collection

Here it says that it\'s a mark-and-sweep garbage collector, but it d

5条回答
  •  孤城傲影
    2020-12-02 05:15

    Go 1.8 GC might evolve again, with the proposal "Eliminate STW stack re-scanning"

    As of Go 1.7, the one remaining source of unbounded and potentially non-trivial stop-the-world (STW) time is stack re-scanning.

    We propose to eliminate the need for stack re-scanning by switching to a hybrid write barrier that combines a Yuasa-style deletion write barrier [Yuasa '90] and a Dijkstra-style insertion write barrier [Dijkstra '78].

    Preliminary experiments show that this can reduce worst-case STW time to under 50µs, and this approach may make it practical to eliminate STW mark termination altogether.

    The announcement is here and you can see the relevant source commit is d70b0fe and earlier.

提交回复
热议问题