通过 linux top 查看到程序占用了 1.8G 内存,但使用 go tool pprof 查看到的只有几 M
go tool pprof http://localhost:6060/debug/pprof/heap
(pprof) top
Showing nodes accounting for 1.78MB, 100% of 1.78MB total
flat flat% sum% cum cum%
1.78MB 100% 100% 1.78MB 100% github.com/mozillazg/go-pinyin.init /root/local/go/src/github.com/mozillazg/go-pinyin/pinyin_dict.go
0 0% 100% 1.78MB 100% _/root/projections/rpc/gox.init <autogenerated>
0 0% 100% 1.78MB 100% main.init <autogenerated>
0 0% 100% 1.78MB 100% runtime.main /root/go/src/runtime/proc.go
(pprof)