mirror of
https://github.com/golang/go
synced 2024-10-14 03:43:28 +00:00
cmd/link: close memory profile
Change-Id: If17e982dd0272e90972d2d4a94b1a744343ae2ec
GitHub-Last-Rev: c8d03566b3
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>
This commit is contained in:
parent
51a96f86f7
commit
8bf9f4bb66
|
@ -519,6 +519,10 @@ func startProfile() {
|
|||
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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue