- Published on
Investigation · Part 15 of 20 · From source to a running process
When malloc Asks the Kernel for Memory: brk and mmap
The usual rule says malloc uses brk below 128 KiB and mmap above. I traced seven allocations and a growing Rust Vec with strace: a 129 KiB block came from the heap, a freed 1 MiB block moved the limit, and Vec growth became a chain of mremap calls.