On Fri, Sep 6, 2019 at 8:36 PM Vincent Blanchon <blanchon.vinc...@gmail.com> wrote: > > The documentation of the profiling > (https://blog.golang.org/profiling-go-programs) explains that: "Go program > stops about 100 times per second". > However, in the code, I could see that the collector has a sleep of 100ms > https://github.com/golang/go/blob/master/src/runtime/pprof/pprof.go#L779. > Therefore, it collects data only 10 times per second? > Also, it does not stop the program since it is a separated goroutine > https://github.com/golang/go/blob/master/src/runtime/pprof/pprof.go#L764. > > Did I miss something here?
The actual profile data is collected by the code in runtime/cpuprof.go and runtime/profBuf.go. That data is generated 100 times per second. The code you are looking at in the runtime/pprof package is the code that is collecting that data, which is generated at interrupt time, and converting it into a format that can be reported to the user or the pprof program. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXkjsaHq%2BLEak9ZEO6afV9MFcCFMjE2WDz%3D23x4uPQ1fA%40mail.gmail.com.