Computing Foundations

Stack and Heap Memory

How programs allocate memory on the stack and the heap, and why each is used.

Why Is Heap Memory Used?

Why is heap memory used? It holds data whose size is unknown in advance, that must outlive a function call, or that parts of a program need to share.

3 min read

Related topics

More in computing foundations