summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-12-24 09:18:43 +0800
committerGitHub <noreply@github.com>2023-12-24 09:18:43 +0800
commitf2add36a29580f5139e3ac5e1fc67ebf2da3cacd (patch)
treef6ba283e37ac917ac9638e437bd95031a2d38600
parent564068aa99be42d18e10247deb458d21b13f1a19 (diff)
downloadgitea-f2add36a29580f5139e3ac5e1fc67ebf2da3cacd.tar.gz
gitea-f2add36a29580f5139e3ac5e1fc67ebf2da3cacd.zip
Include heap pprof in diagnosis report to help debugging memory leaks (#28596) (#28599)
-rw-r--r--routers/web/admin/diagnosis.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/routers/web/admin/diagnosis.go b/routers/web/admin/diagnosis.go
index 5637894e6d..2d550125d5 100644
--- a/routers/web/admin/diagnosis.go
+++ b/routers/web/admin/diagnosis.go
@@ -58,4 +58,11 @@ func MonitorDiagnosis(ctx *context.Context) {
return
}
_ = pprof.Lookup("goroutine").WriteTo(f, 1)
+
+ f, err = zipWriter.CreateHeader(&zip.FileHeader{Name: "heap.dat", Method: zip.Deflate, Modified: time.Now()})
+ if err != nil {
+ ctx.ServerError("Failed to create zip file", err)
+ return
+ }
+ _ = pprof.Lookup("heap").WriteTo(f, 0)
}