mirror of https://github.com/golang/go.git
runtime/pprof: fix resource leak in documentation
Fixes #26970 Change-Id: I0f2695434a53550cf84f702e9d8d02a37448d396 Reviewed-on: https://go-review.googlesource.com/129195 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
3879ea54ed
commit
f2d7e66e98
|
|
@ -28,6 +28,7 @@
|
|||
// if err != nil {
|
||||
// log.Fatal("could not create CPU profile: ", err)
|
||||
// }
|
||||
// defer f.Close()
|
||||
// if err := pprof.StartCPUProfile(f); err != nil {
|
||||
// log.Fatal("could not start CPU profile: ", err)
|
||||
// }
|
||||
|
|
@ -41,11 +42,11 @@
|
|||
// if err != nil {
|
||||
// log.Fatal("could not create memory profile: ", err)
|
||||
// }
|
||||
// defer f.Close()
|
||||
// runtime.GC() // get up-to-date statistics
|
||||
// if err := pprof.WriteHeapProfile(f); err != nil {
|
||||
// log.Fatal("could not write memory profile: ", err)
|
||||
// }
|
||||
// f.Close()
|
||||
// }
|
||||
// }
|
||||
//
|
||||
|
|
|
|||
Loading…
Reference in New Issue