程序员茄子
全部
编程
代码
资讯
案例
综合
联系我们
pprof 相关技术文章
php
mysql
shell
go
vue
css
api接口对接
支付接口对接
Go 1.27 goroutine 泄漏剖析:用 GC 可达性找出永久阻塞的 goroutine
编程
Go 1.27 goroutine 泄漏剖析:用 GC 可达性找出永久阻塞的 goroutine
2026-10-11 21:01:23
Go 1.27 把 goroutineleak 做成正式 pprof profile:借 GC 的可达性计算,找出永久阻塞在 channel 或 sync 原语上的 goroutine。本文给出 /debug/pprof/goroutineleak 的 curl + go tool pprof 用法、五步检测原理,以及它的局限:阻塞在仍可达原语上的泄漏检测不到。
Go
goroutine
pprof
性能
运行时
runtime/pprof
es
net/http
服务
ST
sync
Log
goroutine leak
用 flamegraph 排查 Workers 生产 CPU/内存:从 cf CLI 抓 profile 到 R2 递归调用优化
案例
用 flamegraph 排查 Workers 生产 CPU/内存:从 cf CLI 抓 profile 到 R2 递归调用优化
2026-10-10 20:04:28
Cloudflare Workers 与 Durable Objects 上线按需 CPU/内存 profiling:cf CLI 或 Dashboard 发起采样、看交互式 flamegraph。文中给出 R2 binding 的真实案例——JSON.stringify 递归 replacer 导致嵌套值重复处理、优化后快 2.7 倍;以及内存案例利用 pprof 定位到部分禁用的 Prometheus 代码占 66.7% 分配,修复后 P999 从 133MB 降到 118MB。
Cloudflare
Workers
性能优化
flamegraph
pprof
Serverless
文件
RSI
函数
Go 网关 CPU 尖峰排查:pprof 只看到 3.42s,perf 定位到 futex 锁竞争
编程
Go 网关 CPU 尖峰排查:pprof 只看到 3.42s,perf 定位到 futex 锁竞争
2026-09-28 21:30:55
Go 服务 CPU 飙到 700% 但 pprof 只报 3.42s,原因是信号采样对内核态阻塞"漏采"。用 perf + 火焰图还原调用栈,定位到 sync.RWMutex 写公平引发的 sys_futex 惊群,给出锁分片与 atomic.Value 写时复制两种改法。
Go
性能调优
pprof
perf
锁竞争
Go 1.27 的 goroutineleak profile:只证明「永远卡住」的那类泄漏
编程
Go 1.27 的 goroutineleak profile:只证明「永远卡住」的那类泄漏
2026-09-26 21:02:22
Go 1.27 在 runtime/pprof 新增 goroutineleak profile,靠 GC 可达性判定「无人再能唤醒」的 goroutine 阻塞,只覆盖 channel/同步原语这一类泄漏。本文给出一段可复现的 leak 测试、pprof.Lookup 采集与 pprof 输出读法,并说明它证明不了什么。
Go
goroutine
pprof
并发
调优
死锁
Go 服务 RSS 一直涨:pprof 抓两份 heap 用 -base 对比,定位到 gnet 的 Peek 缓存
编程
Go 服务 RSS 一直涨:pprof 抓两份 heap 用 -base 对比,定位到 gnet 的 Peek 缓存
2026-09-21 21:05:38
Go 服务 RSS 持续上涨不等于内存泄漏。本文给出先看三组指标、埋 pprof、抓两份 heap 用 -base 对比增量的完整流程,并用一个真实案例说明 gnet 的 Peek 分配 cache、Next 只移游标导致 204MB 堆积,Discard(0) 修复后 heap 从 235MB 降到 30MB。
Go
pprof
内存泄漏
性能排查
Go 1.27 的两个测试新件:httptest 加内存内假网络,goroutineleak profile 转 GA
编程
Go 1.27 的两个测试新件:httptest 加内存内假网络,goroutineleak profile 转 GA
2026-09-10 21:04:30
Go 1.27 给测试加了两件新工具:net/http/httptest 的 NewTestServer 提供内存内假网络,可与 testing/synctest 的虚拟时钟配合确定性地测超时与重试;runtime/pprof 的 goroutineleak profile 转 GA,可发现永久阻塞且原语已不可达的 goroutine。本文讲用法与取舍。
Go
测试
pprof
标准库
Go 新增 Goroutine Leak Profiles:用 pprof 定位永不退出的 Goroutine
编程
Go 新增 Goroutine Leak Profiles:用 pprof 定位永不退出的 Goroutine
2026-09-06 10:14:38
Go官方博客介绍Goroutine Leak Profiles,基于pprof性能分析框架的goroutine泄漏检测工具。goroutine泄漏指goroutine被阻塞且解除条件永远无法满足,累积后导致内存和调度开销上升。常见模式包括channel泄漏、mutex泄漏、缺少超时的HTTP请求。工具通过对比不同时间点的goroutine栈快照,识别持续阻塞的goroutine并输出栈跟踪。无需修改代码,可在生产环境使用,输出兼容go tool pprof。配合context超时、CI自动化检测可有效预防泄漏。
Go
Goroutine
pprof
并发
泄漏检测
性能分析
调试
goroutine leak
Go heap profile 明明分配了 126MB 却显示 0
代码
Go heap profile 明明分配了 126MB 却显示 0
2026-09-03 00:31:09
Go memory profile 实战:heap 默认 inuse_space 只查泄漏,分配完就丢的代码会显示为 0。本文用日志拼接四种写法做对照,讲清 inuse_*/alloc_* 四视图、512KB 抽样误差、list/top 定位、-base 差分与 -memprofilerate=1 的成本,以及生产排查思路。
Go
性能优化
pprof
GC
高并发网关 CPU 尖峰排查:pprof 平缓但 perf 揪出 futex 写锁惊群
编程
高并发网关 CPU 尖峰排查:pprof 平缓但 perf 揪出 futex 写锁惊群
2026-09-01 21:31:45
高并发网关 CPU 飙到 700% 但 pprof 一片平缓?本文复盘真实排障:pprof 用 SIGPROF 采样用户态栈,对内核态 futex 阻塞会漏采,改用 perf+火焰图穿透内核定位到 sync.RWMutex 写公平导致的锁竞争惊群。给出 256 分片锁与 COW+atomic.Value 两种解法及各自取舍。
Go
性能调优
pprof
perf
锁竞争
RWMutex
Go 1.27 goroutineleak profile:泄漏检测终于不用肉眼翻堆栈
编程
Go 1.27 goroutineleak profile:泄漏检测终于不用肉眼翻堆栈
2026-08-29 21:13:32
Go 1.27 将 goroutineleak profile 转正为 GA,基于 GC 可达性分析只报告永久阻塞的 goroutine,无需再从海量堆栈里肉眼排查。本文讲清它的机制、启用方式(/debug/pprof/goroutineleak 端点)、与常规 goroutine profile 的区别及适用场景。
Go
pprof
性能排查
Goroutine 泄漏无处遁形:Go 1.27 将 GC 变成并发调试利器
编程
Goroutine 泄漏无处遁形:Go 1.27 将 GC 变成并发调试利器
2026-06-09 20:45:09
Go 1.27正式将goroutine泄漏检测功能从实验特性毕业为标配能力,利用垃圾收集器(GC)的标记阶段来检测goroutine泄漏,让生产环境中的幽灵无处遁形。本文详解其算法原理、实战用法及工程启示。
Go 1.27
Goroutine泄漏
GC
runtime/pprof
并发调试
性能优化
Go语言
pprof
Go 1.26 Goroutine Leak Profiler 深度解析:等了 12 年,一行代码揪出协程泄露
编程
Go 1.26 Goroutine Leak Profiler 深度解析:等了 12 年,一行代码揪出协程泄露
2026-05-05 13:54:01
Go 1.26 引入 goroutine leak profiler,通过 GC 可达性分析检测协程泄露。支持 HTTP 端点实时检测、测试自动检测、生产监控告警,由 Uber 工程师贡献提案,等了 12 年终于落地。
Go
Golang
Goroutine
性能优化
pprof
内存泄露
大家都在搜索什么?
devops
易支付
一个官网+多少钱
统一接受回调
统一回调
python
sub
node
宝塔日志
mysql
shell
ElasticSearch
css
vue
api接口对接
2025
支付接口对接
go
php
php回调