标签:val mem var load targe 内存信息 mst wget get
方法一
wget http://valgrind.org/downloads/valgrind-3.9.0.tar.bz2
tar xvf valgrind-3.9.0.tar.bz2
cd valgrind-3.9.0/
./configure
make
make install
方法二:
sudo apt-get install valgrind
使用:
valgrind --tool=memcheck --leak-check=full valgrind_demo
valgrind --leak-check=full ./xxx
打印内存信息:
var m runtime.MemStats
runtime.ReadMemStats(&m)
log.Printf("Alloc = %v TotalAlloc = %v Sys = %v NumGC = %v\n", m.Alloc/1024, m.TotalAlloc/1024, m.Sys/1024, m.NumGC)
https://pengrl.com/p/29054/
https://www.jianshu.com/p/7ce24f278b0e
https://shengping.space/2018/08/30/012_golang之cgo/
https://www.cnblogs.com/magicsoar/p/7002467.html
https://m.php.cn/be/go/455798.html
https://smileusd.github.io/2018/07/02/golang-map/
标签:val mem var load targe 内存信息 mst wget get
原文地址:https://www.cnblogs.com/tomtellyou/p/14621516.html