在Debian編譯Golang時遇到內存不足,可從代碼優化、編譯優化、系統級調整三方面解決:
pprof
sync.Pool
-ldflags="-s -w"
-parallel
GOCACHE
fallocate
mkswap
swapon
vm.swappiness