From 320cce647d060527bd96b87cdc07151ec1cbe3ed Mon Sep 17 00:00:00 2001 From: Steve Yen Date: Fri, 24 Oct 2014 16:12:01 -0700 Subject: [PATCH] added heap dump during USR2 signal --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index ac084e8..22a171e 100644 --- a/main.go +++ b/main.go @@ -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) } }