Go’s goroutine leak profile proves a narrow class of stalls
Go 1.27 made a runtime profile for leaked goroutines generally available. Its useful guarantee is deliberately narrow: it identifies blocked goroutines that the runtime can prove will never run again, while reachability determines what it can see.
A stuck goroutine is not automatically a leak
On 2 September 2026, the Go team described the goroutine leak profile that became generally available with Go 1.27. The feature addresses a tricky distinction: a goroutine waiting on a channel may be doing exactly what the program intends, or it may be waiting for an event that can never occur. Counting blocked goroutines alone cannot tell those cases apart. [1]
The profile reports a more specific condition: a goroutine is blocked on a supported concurrency primitive and the runtime can establish that no runnable goroutine can ever make the primitive release it. That is stronger than “this goroutine has been waiting for a long time.” It also means the profile should be understood as a proof about some dead ends, not as a census of every goroutine whose lifetime looks suspicious.
The runtime asks whether an unblocker is reachable
The implementation builds on garbage-collector reachability. Imagine a worker blocked sending on an unbuffered result channel after its caller has already returned. If no live, runnable path can receive from that channel, the sender has no future rendezvous. Go’s explanation uses this shape to show how an early return can strand the remaining workers. A buffer large enough for every result may fix that particular ownership and cancellation contract, but a buffer is not a general cure: it changes the communication policy and must be sized for all outcomes. [1]
The reasoning is recursive. A blocked goroutine can be considered live if it is waiting for a primitive that some runnable goroutine could eventually activate. If that possible activator is itself blocked, the runtime must continue following the dependency. When the relevant primitives are unreachable from all runnable goroutines and from the goroutines they could wake, the waiting goroutines cannot make progress. The Go 1.27 release notes describe this reachability test and identify channels and sync primitives among the supported blocking points. [2]
Reachability makes the result precise and incomplete
This method can avoid the ambiguity of a simple threshold. A goroutine that has waited for an hour may still have a valid future wakeup; duration alone cannot establish a leak. Conversely, a permanently stranded sender can be a leak even if it is one goroutine among thousands. The profile gives operators a stack trace tied to the blocked operation, which can direct review toward the protocol that created the wait rather than toward a process-wide count.
The same reachability rule imposes a blind spot. If a channel or other blocking primitive remains reachable through a global variable, or through a local variable held by a runnable goroutine, the runtime may not prove that the blocked goroutine is stranded. This is a limit of what the analysis can establish from the heap graph, not evidence that those goroutines are healthy. A clean profile therefore cannot certify that a service has no leaks. [2]
Use the profile alongside lifecycle tests
In Go 1.27, runtime/pprof exposes the profile under the name goroutineleak; when the standard net/http/pprof handlers are installed, the matching endpoint is /debug/pprof/goroutineleak. The ordinary goroutine profile remains useful for seeing all current stacks. The new one answers a narrower question about goroutines the runtime has classified as leaked. [3] [2]
A practical review starts with cancellation and ownership. For each spawned goroutine, identify the event that ends its work, the owner responsible for delivering that event, and what happens when a caller returns early. Then exercise those paths in tests: successful completion, error returns, timeouts, abandoned requests and shutdown. A profile in staging or production can expose leaks that a test missed; a test that reliably drives a lifecycle edge can keep the underlying contract from regressing.
Treat absence as evidence, not a verdict
The profile is most valuable when its output is interpreted as positive evidence: these stacks are blocked in a way the runtime can prove cannot resolve. It does not replace goroutine snapshots, cancellation design, structured concurrency or targeted tests. Nor does it identify every operation that is stuck; the documented detector is limited to a subset of channel and sync waits.
That distinction is useful beyond Go. Diagnostics become trustworthy when they state what property they can prove and what parts of the system lie outside the proof. For this profile, the property is permanent non-progress established through reachability. The remaining question for an engineer is architectural: why could this goroutine outlive the work that was supposed to own it, and which cancellation or completion edge should make that impossible?