Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Uncontrolled heap retention in Go: how to tell a leak from a healthy cache

说明与用途

godrain 自动比较 Go 服务在稳定负载下的保留堆增长,分类模式并指出持有内存的调用栈,减少手动分析。

问题

Determining whether growing heap memory in a Go service indicates a leak or intentional cache growth.

结果

godrain automates comparison of retained heap growth under steady load, classifies patterns, and points to call stacks responsible for memory retention, reducing manual analysis cycles.

工作流

  • Install godrain via go install
  • Run the target service (e.g., leaky or cached demo)
  • Execute godrain watch with appropriate URL, warmup, duration, and interval
  • Review the output verdict and top stacks
  • Adjust allowlist or load correlation if needed
  • Repeat with realistic traffic and split surfaces if signal is messy

证据

After GC, does retained heap keep climbing without a ceiling — and which call stacks are holding it?

来源

godrain watches a live net/http/pprof endpoint, samples heap with gc=1, aggregates retention by stack, then classifies growth.

来源

Without an allowlist, a growing cache during warm-up looks guilty.

来源

  • 记录日期: 2026-10-10T23:41:40.198Z