1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-23 12:59:11 -05:00

Include heap pprof in diagnosis report to help debugging memory leaks (#28596) (#28599)

This commit is contained in:
Giteabot 2023-12-24 09:18:43 +08:00 committed by GitHub
parent 564068aa99
commit f2add36a29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,4 +58,11 @@ func MonitorDiagnosis(ctx *context.Context) {
return return
} }
_ = pprof.Lookup("goroutine").WriteTo(f, 1) _ = 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)
} }