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

Not working for Golang's memory profiling #370

Open
breezewish opened this issue Oct 21, 2021 · 1 comment
Open

Not working for Golang's memory profiling #370

breezewish opened this issue Oct 21, 2021 · 1 comment

Comments

@breezewish
Copy link

First, thanks for this cool project! Seems that there is a bug when reading from the Go's memory profile:

package main
import (
	"fmt"
	"net/http"
	_ "net/http/pprof"
)
func hello(w http.ResponseWriter, req *http.Request) {
	fmt.Fprintf(w, "hello\n")
}
func headers(w http.ResponseWriter, req *http.Request) {
	for name, headers := range req.Header {
		for _, h := range headers {
			fmt.Fprintf(w, "%v: %v\n", name, h)
		}
	}
}
func main() {
	http.HandleFunc("/hello", hello)
	http.HandleFunc("/headers", headers)
	http.ListenAndServe(":8090", nil)
}
curl http://127.0.0.1:8090/debug/pprof/heap\?seconds\=10 > heap_profile

When loading the heap_profile, error occurs:

Failed to load format Error: Samples must have positive weights
    at n.appendSampleWithWeight (speedscope.026f36b0.js:174)
    at r (/import.e3a73ef4.js:107)
    at /import.e3a73ef4.js:115
    at Generator.next (<anonymous>)
    at s (/import.e3a73ef4.js:115)
@YiniXu9506
Copy link

Can we just ignore the stack with negative weights? The related PR is #375 , PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants