Apex › Systems & OS

How a process is laid out in memory

A program’s memory is one array of bytes, split into regions: code and globals at the bottom, the heap growing up as you allocate, the stack growing down as functions call. Call functions and watch frames pile on — each holding its locals and the saved return address (the value a buffer overflow overwrites) — and malloc to watch the heap climb toward the stack. The map every memory-corruption attack targets.

More in Systems & OS