Tech News
← Home  ·  All topics

Heap Allocation

2 GoKawiil briefs on this topic · RSS for heap allocation

Deep dive explains how glibc's malloc minimizes brk syscalls

A technical write-up traces how glibc's malloc implementation manages memory requests internally rather than calling the kernel every time. Using strace on a test program that calls malloc(16) a thousand times, the analysis shows only two brk syscalls occur in total: one to check the current program break and one to extend the heap by 132 KiB, with the remaining 999 allocations served from that pre-reserved memory.

Blog post details arena allocator technique for memory management in C

A developer-focused article walks through arena allocators as an alternative to standard malloc/free memory management in C. It explains how typical manual allocation leads to problems like forgotten frees, memory leaks, and slow performance from many small allocations, before introducing arena allocators as a solution and detailing their implementation.