heap memory
The pool of memory from which a program allocates objects at run time; objects there can live anywhere and outlive the function that made them.
In more detail
Linked-list nodes are scattered across heap memory and connected by pointers rather than sitting side by side. Despite the name, heap memory has nothing to do with the heap data structure used for priority queues. In Python, every object lives on the heap and is freed by garbage collection.
Related terms
- pointer — A value that stores the memory location of another piece of data, so the program can follow it to that data.
- garbage collection — The automatic freeing of memory held by objects that the program can no longer reach.
- binary heap — A complete binary tree stored in an array in which every parent is ordered before its children, so the smallest (or largest) item is always at the root.
Taught in
- Linked Lists: Nodes, Pointers And Sentinels — Algorithms & Data Structures for Working Engineers