3 ms·
I did suspect that, but now the implication is that the memory allocator is not reusing memory even though it easily could. GLIBC used to have a fixed 128 KiB
by o11c 2y ago
I did suspect that, but now the implication is that the memory allocator is not reusing memory even though it easily could.
GLIBC used to have a fixed 128 KiB threshold, but since 2.25 (2017) it defaults to dynamically adjusting the threshold to prevent exactly this pattern of excess syscalls. A manual threshold disables this though!
(This may be a microoptimization depending on how much real work you're doing between the syscalls, but there's also a good chance that it's easy to fix.)