Change-Id: If17e982dd0272e90972d2d4a94b1a744343ae2ec
GitHub-Last-Rev:
c8d03566b3e66a6de58e778102fa60f5d46ab2d9
GitHub-Pull-Request: golang/go#66531
Reviewed-on: https://go-review.googlesource.com/c/go/+/574335
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Than McIntosh <thanm@google.com>
if err := pprof.Lookup("heap").WriteTo(f, writeLegacyFormat); err != nil {
log.Fatalf("%v", err)
}
+ // Close the file after writing the profile.
+ if err := f.Close(); err != nil {
+ log.Fatalf("could not close %v: %v", *memprofile, err)
+ }
})
}
}