#memory-management

Wiki 6

  • Arena allocation Region-based memory management — allocate many objects into one buffer, hand out references or indices, free the whole region at once
  • How do I deal with memory leaks? Stroustrup's C++ FAQ answer — write code without leaks by hiding allocation in containers and resource handles, not by chasing leaks after the fact
  • RAII Resource Acquisition Is Initialization — bind resource lifetime to object lifetime so cleanup runs deterministically when the object goes out of scope
  • Shrinking 1.1.1.1's DNS cache entries Five Rust memory-layout changes cut Cloudflare's per-entry DNS cache footprint 56% (953 to 420 bytes), freeing ~100 TB and speeding up the cache
  • Speeding up the Gleam formatter with Rust arenas Cavalieri closed a 3-year-old Gleam issue by switching the pretty printer's boxed Document tree to arena references — ~24% faster, ~10% less peak memory
  • Why manual memory management still matters Dayvi Schuster's tour of manual memory management — common pitfalls, the stack/heap mental model, and how C, Fil-C, C++, Zig, Odin, C3, and Rust each handle it

Books 1