Loading...
Loading...
Browse 3 real-world technical and behavioral interview questions about Pprof. Review scenarios, edge cases, and architectural best practices.
Escape analysis moves a value to the heap when the compiler cannot prove its lifetime ends with the frame that created it, and go build -gcflags=-m prints every decision. Which of those allocations matter is a measurement question, answered with a benchmark, an alloc_space profile and benchstat.
A goroutine leak in Go happens when a goroutine blocks forever on a send, receive, network call or abandoned worker path. Find it with goroutine counts and pprof, then add cancellation to every blocking operation. Use this goroutines answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects channels to the point an interviewer is testing.
Take a heap profile and compare two taken minutes apart, because the shape of the growth tells you whether it is a leak, a cache with no bound, or simply the collector letting the heap grow. The two real knobs are GOGC and GOMEMLIMIT, and reducing allocation matters more in Go than in a generational runtime.