-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go1.8.1
What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/xiaoju/go"
GORACE=""
GOROOT="/home/xiaoju/push-auto/go1.8.1"
GOTOOLDIR="/home/xiaoju/push-auto/go1.8.1/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build603754697=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
What did you do?
var memprofile string
flag.StringVar(&memprofile, "memprofile", "memprofile", "write mem profile to this file")
flag.Parse()
var memfd *os.File = nil
var err4 error
if memprofile != "" {
memfd, err4 = os.Create(memprofile)
if err4 != nil {
fmt.Printf("create memprofileFile error, %v", err4)
}
defer memfd.Close()
}
if memfd != nil {
go memProfileLoop(memfd)
}
func memProfileLoop(fd *os.File) {
checkTicker := time.NewTicker(10 * time.Second)
checkTickerChan := checkTicker.C
for {
select {
case <-checkTickerChan:
if fd != nil {
//runtime.GC()
pprof.WriteHeapProfile(fd)
fd.Sync()
}
}
}
}
What did you see instead?
go tool pprof bin/dispatch memprofile
malformed profile: mismatch: sample has: 4 values vs. 1748 types
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.