GODEBUG=gctrace=1 go build ./cmd/server
You can also run this to check memory used when compiling:
go build -toolexec '/usr/bin/time -v'
# For macOS
go build -toolexec '/usr/bin/time -alh'
go clean --cache
du -hs $(go env GOCACHE)
GODEBUG=gctrace=1 go build ./cmd/server
You can also run this to check memory used when compiling:
go build -toolexec '/usr/bin/time -v'
# For macOS
go build -toolexec '/usr/bin/time -alh'
go clean --cache
du -hs $(go env GOCACHE)