Go Memory Management

Review how Go handles memory allocation,garbage collection,and pointers.

1. Which memory area is typically used for short-lived variables with a known size at compile time in Go?
2. Which of the following can cause a variable to be allocated on the heap in Go (select all that apply)?
3. Go's garbage collector uses a concurrent mark-and-sweep algorithm with tri-color marking by default.
4. What term describes the process by which a Go compiler determines if a variable should be allocated on the heap instead of the stack?
5. Which of the following is NOT a responsibility of Go's garbage collector?
6. Which of the following are common causes of memory leaks in Go applications (select all that apply)?
7. In Go, a variable declared with the 'new' keyword is always allocated on the heap.
8. Name the Go tool used to profile memory usage and identify allocation patterns (command-line tool name).
9. Which of the following is a value type in Go, meaning it is passed by value rather than by reference?
10. Which environment variables can be used to tune Go's garbage collection behavior (select all that apply)?
Answered 0 of 0 — 0 correct