Skip to main content

Module memory

Module memory 

Source
Expand description

Allocator maintenance. glibc parks freed pages on its per-arena free lists rather than returning them, so a process that peaked stays resident at that peak long after the peak’s memory is free (#61, #245). malloc_trim asks for the top of each arena back.

Functions§

trim_allocator
Ask glibc to return freed pages to the OS. Call only from a quiescent point: glibc walks and locks every arena in turn, so a caller mid-workload pays for the walk and stalls every concurrently allocating thread.