diff options
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/admin/diagnosis.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/routers/web/admin/diagnosis.go b/routers/web/admin/diagnosis.go index 1c12259b06..959c9bc444 100644 --- a/routers/web/admin/diagnosis.go +++ b/routers/web/admin/diagnosis.go @@ -6,6 +6,7 @@ package admin import ( "archive/zip" "fmt" + "runtime" "runtime/pprof" "runtime/trace" "time" @@ -73,5 +74,8 @@ func MonitorDiagnosis(ctx *context.Context) { ctx.ServerError("Failed to create zip file", err) return } + // To avoid showing memory that actually can be cleaned, run the garbage + // collector. + runtime.GC() _ = pprof.Lookup("heap").WriteTo(f, 0) } |