Skip to content

Commit

Permalink
added heap dump during USR2 signal
Browse files Browse the repository at this point in the history
  • Loading branch information
steveyen committed Oct 24, 2014
1 parent a8faad9 commit 320cce6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ func dumpOnSignal(signals ...os.Signal) {
c := make(chan os.Signal, 1)
signal.Notify(c, signals...)
for _ = range c {
log.Printf("dump: goroutine...")
pprof.Lookup("goroutine").WriteTo(os.Stderr, 1)
log.Printf("dump: heap...")
pprof.Lookup("heap").WriteTo(os.Stderr, 1)
}
}

0 comments on commit 320cce6

Please sign in to comment.