Tagged articles
pprof
37 articles · Page 1 of 1
Go 1.27 introduces a goroutine leak profiler that uses a modified garbage collector to identify permanently blocked goroutines on channels and sync primitives in running programs, including production, with minimal overhead and near-zero false positives, demonstrated through real-world examples from CockroachDB, etcd, Kubernetes, and Moby.
Go 1.27channelconcurrency debugging
0 likes · 29 min read

This article presents a systematic, evidence-driven framework for Go memory optimization, covering allocation profiling, GC tuning, container memory accounting, runtime metrics observability, and validation methodologies to prevent Kubernetes OOM kills while meeting SLOs.
GOGCGOMEMLIMITGo
0 likes · 40 min read


TonyBaiSep 26, 2026 · Backend Development
A Go proposal (#79179) provisionally accepted to add a memory_space sample type to heap/alloc profiles, providing a full memory hierarchy from RSS down to live/dead heap, stacks, runtime, and non-Go memory, solving the long-standing gap where heap profiles show only about 50% of actual RSS.
GoRuntimeheap profile
0 likes · 12 min read


TonyBaiSep 21, 2026 · Backend Development
Go proposal #75047 aims to automatically attach goroutine labels (test name and iteration) during test execution, enabling developers to quickly identify which test owns a stuck goroutine in timeout dumps, leveraging the existing pprof label mechanism and runtime traceback enhancements.
CIDebuggingGo
0 likes · 14 min read

This comprehensive guide covers the most frequent Go interview topics for 2026, including project engineering, slice and map internals, interface mechanics, the GMP scheduler, channel implementation, context usage, memory‑leak pitfalls, pprof profiling, garbage‑collection details, escape analysis, memory alignment, defer traps, sync.Pool, and reflection, all illustrated with concrete code examples and step‑by‑step explanations.
ConcurrencyGCGo
0 likes · 35 min read

This article presents five practical Go techniques—using context for graceful cancellation, enriching errors with fmt.Errorf, leveraging sync.Pool to reduce GC pressure, employing pprof for performance profiling, and designing testable code with dependency injection—each illustrated with real‑world code examples and common pitfalls.
Best PracticesContextGo
0 likes · 7 min read

This guide explains how Goroutine leaks cause hidden memory and CPU issues in long‑running Go health‑check tools, demonstrates how to reproduce the problem, and shows step‑by‑step detection using pprof and context, plus a production‑ready zero‑leak probe template with best‑practice code.
Memory Leakopspprof
0 likes · 12 min read


TonyBaiJan 31, 2026 · Backend Development
The article analyzes recent Go runtime meeting notes that reveal upcoming changes such as lightweight race detection via software or hardware, a new instant‑open Trace UI with on‑demand slicing, read/write Trace APIs, pprof modernization removing global variables, NUMA‑aware GC optimizations and sharded counters, all pointing to a more usable and high‑performance Go 1.27.
Execution TraceGoNUMA
0 likes · 8 min read

This article explains how Go's experimental goroutineleak experiment integrates leak detection into the garbage collector, describes the underlying sudog mechanism, and provides step‑by‑step instructions to enable the feature, run a demo, and analyze leaks using pprof.
DebuggingGCGo
0 likes · 8 min read

This guide explains why and how to use Go's pprof and trace tools to diagnose memory leaks, goroutine stalls, and CPU bottlenecks, providing step‑by‑step commands, example code, a cheat‑sheet of core commands, and a practical workflow for microservice tracing.
BackendGomicroservices
0 likes · 8 min read

After migrating thousands of Java cores to Rust, the team used jemalloc and pprof profiling to pinpoint why a few services only improved 10%, refactored the OSS client for reuse, and achieved up to 20% CPU reduction and significant memory savings, demonstrating the power of deep performance analysis in production Rust services.
Rustasyncjemalloc
0 likes · 14 min read

This comprehensive guide explains how to use Go's built‑in pprof tool to profile CPU, memory, and goroutine behavior, covering integration methods, command‑line analysis, visualization techniques, and step‑by‑step solutions for common performance bottlenecks in production Go services.
CPU optimizationGobackend development
0 likes · 16 min read

The article teaches Go developers how to generate and analyze CPU, heap, allocation, and goroutine profiles with pprof and full‑runtime traces, interpret SVG flame‑graphs, top lists, and source views, and apply concrete optimizations—such as buffering channels and using sync.Pool—to dramatically speed up a Mandelbrot generator.
GoHeap Analysisgoroutine
0 likes · 58 min read

Conan is an automated profiling solution for Go microservices that embeds an SDK to continuously or adaptively sample CPU, memory and goroutine metrics, detects anomalies via user‑defined rules, uploads data to a Pyroscope server, and reports results through Feishu or Pyroscope, delivering sub‑5 % overhead and faster root‑cause analysis.
GoPyroscopeautomation
0 likes · 16 min read

This comprehensive guide teaches Go developers how to generate CPU, memory, and goroutine profiles with pprof, interpret SVG, top, source, and peek visualizations, understand the runtime’s sampling and allocation internals, use the trace tool to analyze events, and apply these techniques to real‑world optimizations such as speeding up a Mandelbrot image generator.
Goperformance profilingpprof
0 likes · 57 min read

This guide walks through Go's pprof tool, detailing each command‑line option, its purpose, and example usage so developers can comprehensively profile, visualise, and optimise Go applications for better performance and stability.
DebuggingGocommand-line
0 likes · 24 min read

This guide explains how to use Go's built‑in pprof tool and the go tool pprof command to profile CPU and memory usage, generate analysis files, interpret interactive console output, create flame graphs, and apply practical optimizations for faster, more efficient Go applications.
CPU profilingFlame GraphGo
0 likes · 6 min read

This article explains Go's memory escape phenomenon, why variables move to the heap, its impact on garbage collection performance, and practical techniques—including pointer usage, closure avoidance, and compiler tools—to minimize escape and improve program efficiency.
Compiler Flagsgarbage collectionmemory escape
0 likes · 4 min read

After a high‑traffic Go service’s availability slipped below the 99.9% target, the team traced the issue through pprof, gctrace, strace, fgprof, and heap analysis, ultimately identifying a memory‑leak bug in the third‑party gcache LFU implementation and resolving it with an upgrade.
gcacheperformancepprof
0 likes · 11 min read

This article details the systematic investigation of intermittent availability drops in a high‑throughput Go service, covering hypothesis formulation, extensive profiling with pprof, gctrace, strace, fgprof, go trace, heap analysis, the discovery of a gcache LFU bug, and the final remediation steps.
BackendGCGo
0 likes · 10 min read

The article details how a Go service’s default GOGC setting caused overly frequent garbage‑collection pauses that spiked request timeouts, and how adjusting GOGC dynamically with debug.SetGCPercent and setting memory limits reduced GC CPU usage, extended pause intervals, and eliminated timeout spikes.
GC optimizationGOGCGo Memory Management
0 likes · 20 min read

Using Go’s pprof, the team traced a gradual CPU spike in a high‑throughput kafka‑go consumer to a saturated commit queue and repeatedly nested context values, which forced costly lookups; eliminating the unnecessary trace‑id context injection (or recreating a fresh context each loop) resolved the issue and reduced CPU usage to under 2 %.
CPU profilingConsumerContext
0 likes · 10 min read

The article explains how a sudden Go service memory‑usage alert was traced with go tool pprof to a massive allocation in the quantile.newStream function, uncovered a Prometheus metric‑label explosion caused by the START_POINT label, and resolved the leak by disabling that label, while also reviewing typical Go memory‑leak patterns.
BackendGoMemory Leak
0 likes · 15 min read

This article explains why traditional pprof sampling often fails in production, introduces Go's built‑in profiling tools and runtime.pprof, defines practical rules for triggering automatic sampling based on resource spikes, and demonstrates using the open‑source Holmes library and Docker demo to collect self‑diagnostic profiles.
GoPerformance MonitoringRuntime
0 likes · 12 min read


ITPUBJun 30, 2022 · Backend Development
This article presents a layered approach to Go performance optimization, covering reasonable code practices, deliberate algorithmic and structural improvements, risky low‑level tweaks, and practical profiling techniques such as pprof, flame graphs, and trace, while providing concrete examples and actionable guidance.
GoSlice CapacityUnsafe
0 likes · 17 min read

This article explains why Go programs can still exhibit memory growth despite automatic garbage collection, describes how to identify and diagnose such issues with the built‑in pprof tool, and details the underlying sampling mechanism, memory fragmentation, and cgo‑related allocations.
GCGoRuntime
0 likes · 9 min read

This comprehensive guide explores Go performance optimization techniques, covering pprof profiling, trace analysis, GODEBUG diagnostics, and escape analysis, while providing practical code examples and real‑world case studies to help developers identify and resolve CPU, memory, and goroutine bottlenecks in production services.
GODEBUGGoPerformance Tuning
0 likes · 40 min read

This article explains how to use Go's test command with various flags such as -c, -run, -timeout, and -coverprofile, demonstrates writing test cases, TestMain setup, benchmarking, profiling with pprof, generating flame graphs, and interpreting coverage reports to improve Go application reliability and performance.
BenchmarkCoverageGo
0 likes · 11 min read

The article outlines a systematic SOP‑driven approach for diagnosing online service alarms and performance issues in Go, detailing a toolbox that includes pprof, trace, goroutine visualizers, perf and eBPF, and recommends application‑level optimizations, system tuning, and continuous profiling to accelerate root‑cause identification and reduce incident frequency.
GoOnline ServiceSOP
0 likes · 11 min read

The case study walks through debugging a Go production service that regularly spiked to over 6 GB of resident memory, revealing that unbuffered channel leaks, mis‑configured HTTP client timeouts, and ultimately a cgo‑based image‑processing library spawning unmanaged threads caused the leaks, and outlines a systematic troubleshooting workflow.
DebuggingMemory Leakcgo
0 likes · 12 min read

This article demonstrates how to use Google’s tcmalloc library and the pprof tool to capture and analyze MySQL heap dumps, revealing memory allocations that performance_schema cannot track, and explains the experimental setup, data collection, and interpretation of the resulting memory allocation graphs.
MySQLTCMallocperformance_schema
0 likes · 4 min read

The article outlines why high‑load Go services need performance tuning and presents a systematic workflow—preparation, analysis with Linux tools and Go’s pprof/trace, targeted optimizations such as goroutine pooling, Redis MSET, efficient JSON handling and slice resizing—demonstrating how these changes boost throughput, lower latency, and stabilize memory usage while offering broader Go‑specific best‑practice recommendations.
ConcurrencyGoLinux
0 likes · 25 min read

Learn a systematic approach to diagnosing Kubernetes core component issues by identifying faulty nodes, analyzing logs via systemd or static pods, and leveraging Go's pprof tool for performance profiling, including step‑by‑step commands and UI visualizations for components like kube‑apiserver, scheduler, controller‑manager, and kubelet.
Kubernetescloud-nativelogs
0 likes · 9 min read

This guide shows how Go simplifies unit testing, benchmarking, CPU profiling with pprof, and live debugging using dlv, providing step‑by‑step code examples, command‑line usage, and visual analysis techniques for backend developers.
BackendBenchmarkGo
0 likes · 7 min read

This article walks through generating load with Vegeta, using pprof and Go trace to pinpoint massive heap allocations caused by the chi compression middleware, and shows how upgrading the library and disabling the middleware reduced allocations by nearly a hundred‑fold while improving GC performance.
Compression MiddlewareVegetamemory profiling
0 likes · 8 min read

The article demonstrates how Go’s built‑in pprof tools can be used for live performance profiling, walking through two real‑world cases—one where a malformed JSON request caused massive object allocation and CPU spikes, and another where per‑call self‑referencing structs leaked memory—while offering practical tips on input validation, allocation reduction, and GC monitoring.
CPU optimizationGoMemory Leak
0 likes · 16 min read

This article explains what goroutine leaks are, demonstrates how they occur in Alibaba's PouchContainer runtime, and provides practical detection methods and code‑level fixes using net/http/pprof, runtime.NumGoroutine, and CloseNotifier to keep Go services healthy.
container-runtimegoroutineleak detection
0 likes · 14 min read
