Skip to content

cmd/pprof: alloc_space top shows nothing on 1.7 #16128

@ernado

Description

@ernado
  1. What version of Go are you using (go version)?
    go version go1.7beta2 linux/amd64
  2. What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build479686971=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
  1. What did you do?
    I'm trying to profile my benchmark memory usage with pprof.
cd $GOPATH/src/github.com/ernado/sdp
go version
go test -bench BenchmarkDecoder_Decode -memprofile=mem.out -o sdp.test
go tool pprof -alloc_space -top sdp.test mem.out

I've created repo that runs this commands in docker container for go 1.6 and 1.7 to isolate enviroment and make it easy to reproduce:
https://github.com/ernado/go-no-bench
To use it, just run make.
I've also uploaded docker images to registry.

On 1.6 it works OK.

  1. What did you expect to see?

This is output of docker run -it --rm ernado/sdp-reproduce:1.6

573.65MB of 576.15MB total (99.57%)
Dropped 7 nodes (cum <= 2.88MB)
      flat  flat%   sum%        cum   cum%
  113.51MB 19.70% 19.70%   113.51MB 19.70%  bytes.genSplit
  113.40MB 19.68% 39.38%   130.40MB 22.63%  github.com/ernado/sdp.(*Decoder).decodeAttribute
   95.47MB 16.57% 55.96%   104.97MB 18.22%  github.com/ernado/sdp.(*Decoder).decodeTimingField
   71.75MB 12.45% 68.41%    98.25MB 17.05%  github.com/ernado/sdp.(*Decoder).decodeTimeZoneAdjustments
   50.50MB  8.77% 77.17%    50.50MB  8.77%  github.com/ernado/sdp.(*Decoder).decodeKV
   44.01MB  7.64% 84.81%    51.51MB  8.94%  github.com/ernado/sdp.(*Decoder).decodeBandwidth
      29MB  5.03% 89.85%   576.15MB   100%  github.com/ernado/sdp.(*Decoder).decodeField
   17.50MB  3.04% 92.88%       25MB  4.34%  github.com/ernado/sdp.(*Decoder).decodeConnectionData
   15.50MB  2.69% 95.57%    15.50MB  2.69%  github.com/ernado/sdp.parseNTP
   10.50MB  1.82% 97.40%    10.50MB  1.82%  bytes.Join
    7.50MB  1.30% 98.70%       26MB  4.51%  github.com/ernado/sdp.(*Decoder).decodeRepeatTimes
       5MB  0.87% 99.57%        5MB  0.87%  net.parseIPv4
         0     0% 99.57%   113.51MB 19.70%  bytes.Split
         0     0% 99.57%   576.15MB   100%  github.com/ernado/sdp.(*Decoder).Decode
         0     0% 99.57%       26MB  4.51%  github.com/ernado/sdp.(*Decoder).decodeEncryption
         0     0% 99.57%   219.04MB 38.02%  github.com/ernado/sdp.(*Decoder).decodeMedia
         0     0% 99.57%    56.50MB  9.81%  github.com/ernado/sdp.(*Decoder).decodeMediaDescription
         0     0% 99.57%    28.50MB  4.95%  github.com/ernado/sdp.(*Decoder).decodeOrigin
         0     0% 99.57%   576.15MB   100%  github.com/ernado/sdp.(*Decoder).decodeSession
         0     0% 99.57%   130.97MB 22.73%  github.com/ernado/sdp.(*Decoder).decodeTiming
         0     0% 99.57%   103.51MB 17.97%  github.com/ernado/sdp.(*Decoder).subfields
         0     0% 99.57%   576.15MB   100%  github.com/ernado/sdp.BenchmarkDecoder_Decode
         0     0% 99.57%        5MB  0.87%  github.com/ernado/sdp.decodeIP
         0     0% 99.57%   103.51MB 17.97%  github.com/ernado/sdp.subfields
         0     0% 99.57%        5MB  0.87%  net.ParseIP
         0     0% 99.57%   576.15MB   100%  runtime.goexit
         0     0% 99.57%   576.15MB   100%  testing.(*B).launch
         0     0% 99.57%   576.15MB   100%  testing.(*B).runN
  1. What did you see instead?

And this is docker run -it --rm ernado/sdp-reproduce:1.7:

565.81MB of 565.81MB total (  100%)
      flat  flat%   sum%        cum   cum%
  565.81MB   100%   100%   565.81MB   100%  [sdp.test]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions