An overview of memory management in Go (2021)
medium.com·15h·
Discuss: Hacker News
Flag this post

8 min readMay 9, 2021

As programs run they write objects to memory. At some point these objects should be removed when they’re not needed anymore. This process is called memory management. This article aims to give an overview of memory management, and then dive deeper into how this is implemented in Go by using a garbage collector. Go has seen many changes to its memory management over the years, and will most likely see more in the future. If you’re reading this and you’re using a version of Go later than 1.16, some of this information may be outdated.

Manual Memory Management

In a language like C the programmer will call a function such as malloc or calloc to write an object to memory. These functions return a pointer to the location of that object in heap mem…

Similar Posts

Loading similar posts...