Skip to content

Not working for Golang's memory profiling #370

@breezewish

Description

@breezewish

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions