Pre-allocating memory statically.
Using the heap only for large allocations.
Pooling memory
- Allocate a large chunk at the beginning of the a section that will churn through a lot of memory.
- Provide functions that manage allocations from the pool.
- Section that churns memory only uses the pool for its memory.
- At the end of the section, the entire pool is released.
- Windows CE has functions that enable heap creation and heap destruction. Basically enabling heap pooling.
Kernels often rerange their own memory.
- That’s whay they hand out handles instead of pointers.
- Handles allow a level of indirection between the user and the resource.
- The handle never changes, but the resouce can be moved.
- Handles can be a simple index into a table of pointers.