💻 Tech
If you just use pprof
like below, it only shows you live memory at the time of snapshot. It’s using inuse_space
by default. But how about if you wan to use all the memory allocated over time even those that are freed? Use alloc_space
.
Default inuses_space
go tool pprof -http=:8081 mem.prof
Using alloc_space
go tool pprof --alloc_space -http=:8081 mem.prof