UnownHash / Fletchling

10 stars 3 forks source link

GC debug route fiddling #25

Closed comstud closed 7 months ago

comstud commented 7 months ago

Rename /debug/gc-flush to /debug/gc/flush. Turns out pprof has this available, also, via /debug/pprof/heap?gc=1. Oh well.

Add 'PUT /debug/gc/free'. This route calls (runtime/)debug.FreeOSMemory(), which runs the GC and then tries to return as much memory to the OS as possible.

comstud commented 7 months ago

Works as expected.