A range of memory that the operating system allocates as needed for a program. Multiple ranges can be allocated with multiple requests.
Properties, Pros and Cons
Properties | Implications |
---|---|
Size is dynamic | ✅ You can store a large amount of memory without worrying about stack overflows ✅ You can store data structures of dynamic sizes 🚫 System Call for additional memory is slow |
Inherently fragmented | ✅ Allows for data structure of dynamic sizes 🚫 Requires keeping track of a vtable, which takes up a bit of cycles and memory. 🚫 Allocations within the heap requires searching through sub-regions in the heap |
Memory has to be manually managed | 🚫 Leading to runtime errors common to many low-level languages |
Fast accessing times if used correctly |