Garbage collection in Go

One major change in Go from C/C++ is that Go has a garbage collector. As we may concern, garbage collection causes runtime overhead. However, as mentioned in the FAQ in the Go website [1], the Go developers believe that

it's critical to eliminate that programmer overhead, and advances in garbage collection technology in the last few years give us confidence that we can implement it with low enough overhead and no significant latency.

Another challenge regarding memory management is how to handle it in a concurrent and multi-threading environment. As Go is designed to be simple, although the Go developers admit GC implementation with concurrency, but it makes programming much easier.

GC has relatively low latency as claimed at the official document [2]. However, like Java, programmers can call function runtime.FC() to force garbage collection. However, it will block the entire program [3].

[1] https://golang.org/doc/faq#garbage_collection

[2] https://golang.org/s/go14gc

[3] https://golang.org/pkg/runtime/#GC