A memory allocator works within one or more big blocks of memory (‘arenas’), and tracks which areas are free and which are used.

It may need to request more memory from the OS if the chunk is exhausted. It will need to be able to reclaim chunks when they become unused.
In modern language runtimes, a garbage collector may be provided which provides automatic reclamation of memory once variables fall out of scope. We are only considering manual memory management for the purpose of this.