Skip to content

Commit 330aab4

Browse files
authored
Include heap pprof in diagnosis report to help debugging memory leaks (#28596)
1 parent 33439b7 commit 330aab4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: routers/web/admin/diagnosis.go

+7
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,11 @@ func MonitorDiagnosis(ctx *context.Context) {
5858
return
5959
}
6060
_ = pprof.Lookup("goroutine").WriteTo(f, 1)
61+
62+
f, err = zipWriter.CreateHeader(&zip.FileHeader{Name: "heap.dat", Method: zip.Deflate, Modified: time.Now()})
63+
if err != nil {
64+
ctx.ServerError("Failed to create zip file", err)
65+
return
66+
}
67+
_ = pprof.Lookup("heap").WriteTo(f, 0)
6168
}

0 commit comments

Comments
 (0)