- Home
- Profiling Software
- Go pprof
On the recordRead 4 Oct 202623 facts
Go pprof
On the record
- Analysis tool
- The Go command-line tool interprets and displays profiles of Go programs and can be invoked as go tool pprof binary profile.pkg.go.dev · read 3 Oct 2026
- CPU and memory profiling
- Go’s testing package supports profiling benchmarks with go test flags that write CPU and memory profiles.pkg.go.dev · read 3 Oct 2026
- CPU profile limit
- CPU profiling uses StartCPUProfile and StopCPUProfile because CPU profiles stream output to a writer rather than appearing as a Profile.pkg.go.dev · read 3 Oct 2026
- CPU profiling
- StartCPUProfile enables CPU profiling for the current process and writes buffered profile data to an io.Writer.pkg.go.dev · read 4 Oct 2026
- Custom profiles
- Packages can create and maintain named profiles, commonly to track resources that must be explicitly closed, such as files or network connections.pkg.go.dev · read 4 Oct 2026
- Heap profiling
- The heap profile reports allocation statistics from the most recently completed garbage collection, subject to the documented no-GC exception.pkg.go.dev · read 4 Oct 2026
- HTTP integration
- Importing net/http/pprof installs handlers under /debug/pprof/ for downloading live profiles.pkg.go.dev · read 4 Oct 2026
- HTTP profiles
- The net/http/pprof package serves live runtime profiles through HTTP handlers under /debug/pprof/.pkg.go.dev · read 3 Oct 2026
- Kernel caveat
- The documentation cautions that profiles are only as good as the kernel support used to generate them.pkg.go.dev · read 3 Oct 2026
- Labels
- Context labels can be attached to profiling data, and the documentation says only CPU and goroutine profiles currently use label information.pkg.go.dev · read 4 Oct 2026
- License
- The package documentation lists the license as BSD-3-Clause.pkg.go.dev · read 3 Oct 2026
- License and project
- Go is an open source project developed by a team at Google and community contributors, distributed under a BSD-style license.go.dev · read 4 Oct 2026
- Limits
- The documentation cautions that profile quality depends on kernel support and notes a Unix-like c-archive/c-shared CPU profiling limitation involving SIGPROF.pkg.go.dev · read 4 Oct 2026
- Platform caveat
- On Unix-like systems, CPU profiling does not work by default for Go code built with -buildmode=c-archive or -buildmode=c-shared.pkg.go.dev · read 3 Oct 2026
- Profile format
- Profile.WriteTo can emit a gzip-compressed protocol buffer or a legacy text format with function names and line numbers.pkg.go.dev · read 3 Oct 2026
- Profile output
- Profile.WriteTo can write gzip-compressed protocol buffer data or a legacy text format, depending on its debug argument.pkg.go.dev · read 4 Oct 2026
- Profiles
- Predefined profiles cover goroutines, memory allocations, OS thread creation, blocking, and mutex contention.pkg.go.dev · read 4 Oct 2026
- Profile types
- The documented predefined profiles include goroutine, goroutineleak, allocs, heap, threadcreate, block, and mutex.pkg.go.dev · read 3 Oct 2026