Menu

Do I need to import specific pkg to use GODEBUG="allocfreetrace=1"

#golang#redditgolang#memory#users#code
Reading 0:00
15s threshold

Base on what I read so far and https://go.dev/wiki/Performance#memory-allocator-trace , I should be able just do

GODEBUG=allocfreetrace=1 go run .

or

GODEBUG=allocfreetrace=1

However, I don't see any additional output. Anyone have clue what I maybe missing?

Following is my go env

❯ go env AR='ar' CC='cc' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_ENABLED='1' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' CXX='c++' GCCGO='gccgo' GO111MODULE='' GOARCH='arm64' GOARM64='v8.0' GOAUTH='netrc' GOBIN='/Users/js/code/go/bin' GOCACHE='/Users/js/Library/Caches/go-build' GOCACHEPROG='' GODEBUG='allocfreetrace=1' GOENV='/Users/js/Library/Application Support/go/env' GOEXE='' GOEXPERIMENT='' GOFIPS140='off' GOFLAGS='' GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/1g/md7q63kd08sfmpl7zx4zqfym0000gn/T/go-build3532125912=/tmp/go-build -gno-record-gcc-switches -fno-common' GOHOSTARCH='arm64' GOHOSTOS='darwin' GOINSECURE=''…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.