Hao Liang's Blog

Embrace the World with Cloud Native and Open-source

【Operating System】Go Runtime's MADV_FREE memory release issue

1. Background Related issues: runtime: memory not being returned to OS #22439 runtime: provide way to disable MADV_FREE When using applications compiled with go 1.12~1.15, it often happens that after the application is started, the resident memory RSS continues to increase as the running time increases, and the memory is never released. 2. Issue Analysis Use pprof to analyze various memory usage in Go Runtime. The following is the meaning of various memories in pprof: