Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ernado opened this issue Jun 20, 2016 · 4 comments
Closed

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

ernado opened this issue Jun 20, 2016 · 4 comments
Assignees
Milestone

Comments

@ernado
Copy link
Contributor

@ernado ernado commented Jun 20, 2016

  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]
@ianlancetaylor ianlancetaylor added this to the Go1.7Maybe milestone Jun 20, 2016
@LK4D4
Copy link
Contributor

@LK4D4 LK4D4 commented Jun 20, 2016

Actually, all memory profile options(-inuse_space, -inuse_objects...) doesn't work. Also, it doesn't work on beta1 as well.

@ernado
Copy link
Contributor Author

@ernado ernado commented Jun 20, 2016

It works on go version devel +1a3e4f0 Tue May 17 14:55:14 2016 +0000 linux/amd64.
I'm going to bisect version later if nobody will do it faster than me.

@ernado
Copy link
Contributor Author

@ernado ernado commented Jun 20, 2016

Bisected to commit 4223294 "runtime/pprof, cmd/pprof: fix profiling for PIE" 🎯
87ee12c works OK.

@ianlancetaylor ianlancetaylor self-assigned this Jun 20, 2016
@ianlancetaylor ianlancetaylor modified the milestones: Go1.7, Go1.7Maybe Jun 20, 2016
@gopherbot
Copy link

@gopherbot gopherbot commented Jun 20, 2016

CL https://golang.org/cl/24274 mentions this issue.

@gopherbot gopherbot closed this in 252eda4 Jun 21, 2016
@golang golang locked and limited conversation to collaborators Jun 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.