Skip to content

Commit

Permalink
fix: close profiles (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill authored Apr 28, 2024
1 parent 48a9ee9 commit 6793ff4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ func main() {
if err != nil {
panic(err)
}
defer f.Close()
defer pprof.StopCPUProfile()
memProf, err := os.Create("mem.prof")
if err != nil {
panic(err)
}
defer memProf.Close()
defer pprof.WriteHeapProfile(memProf)
}

Expand Down

0 comments on commit 6793ff4

Please sign in to comment.