Currently we employ the ugly "hack" of using debug.FreeOSMemory() to force a GC run after every request. However, without that "hack" our memory consumption will lead to OOM situations.
Additionally we may have sometimes got some artifacts not properly freed and returned to the OS.
Goal: Remove debug dependency and ensure normal GC runs actually pick up the memory, somehow, and in a timely manner (if possible).
Get rid of any orphaned artifacts in the memory. (If they indeed are persistent as pprof suggests)
Currently we employ the ugly "hack" of using debug.FreeOSMemory() to force a GC run after every request. However, without that "hack" our memory consumption will lead to OOM situations. Additionally we may have sometimes got some artifacts not properly freed and returned to the OS.
Goal: Remove debug dependency and ensure normal GC runs actually pick up the memory, somehow, and in a timely manner (if possible). Get rid of any orphaned artifacts in the memory. (If they indeed are persistent as pprof suggests)