mirror of
https://github.com/golang/go
synced 2024-11-15 02:40:32 -07:00
cmd/link: close memory profile
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
This commit is contained in:
parent
f6b93a4c35
commit
c8d03566b3
@ -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 New Issue
Block a user