mirror of
https://github.com/DataDog/go-profiler-notes.git
synced 2026-06-21 00:46:51 +08:00
Add reference to the official Go GC guide (#19)
This commit is contained in:
parent
ea39719244
commit
6ab2a357b5
1 changed files with 2 additions and 0 deletions
|
|
@ -64,6 +64,8 @@ However, the model above should be sufficient to understand the remainder of thi
|
||||||
|
|
||||||
The other major abstraction in Go is the garbage collector. In languages like C, the programmer needs to manually deal with allocating and releasing memory using `malloc()` and `free()`. This offers great control, but turns out to be very error prone in practice. A garbage collector can reduce this burden, but the automatic management of memory can easily become a performance bottleneck. This section of the guide will present a simple model for Go's GC that should be useful for identifying and optimizing memory management related problems.
|
The other major abstraction in Go is the garbage collector. In languages like C, the programmer needs to manually deal with allocating and releasing memory using `malloc()` and `free()`. This offers great control, but turns out to be very error prone in practice. A garbage collector can reduce this burden, but the automatic management of memory can easily become a performance bottleneck. This section of the guide will present a simple model for Go's GC that should be useful for identifying and optimizing memory management related problems.
|
||||||
|
|
||||||
|
For a more in-depth guide on Go's GC, refer to the [official documentation](https://go.dev/doc/gc-guide).
|
||||||
|
|
||||||
#### The Stack
|
#### The Stack
|
||||||
|
|
||||||
Let's start with the basics. Go can allocate memory in one of two places, the stack or the heap. Each goroutine has its own stack which is a contiguous area of memory. Additionally there is a big area of memory shared between goroutines that is called the heap. This can be seen in the picture below.
|
Let's start with the basics. Go can allocate memory in one of two places, the stack or the heap. Each goroutine has its own stack which is a contiguous area of memory. Additionally there is a big area of memory shared between goroutines that is called the heap. This can be seen in the picture below.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue