mosalloc:
Mosaic Memory Allocator

The Mosaic Memory Allocator – mosalloc – allows its users to back the memory of an application with some arbitrary predetermined heterogeneous collection of pages with different sizes (4KB, 2MB, and/or 1GB) on an x86 machine. All memory allocations of the application that links against mosalloc are fulfilled by mosalloc: data, heap, and stack.

The allocator is primarily useful for architectural virtual memory studies. It allows researchers to construct mathmatical models that predict the runtime of applications executing on top of some newly proposed virtual memory design. This methodology requires a partial simulation of only the said newly proposed memory subsystem, as opposed to a full "cycle accurate" simulation of the entire processor. The resulting mathmatical models are much more accurate than preexisting models.

Resources:

  • A paper that describes and motivates mosalloc was published in MICRO '20.
  • The source code repository of mosalloc can be found here, and the scripts that generate the aforementioned mathmatical models (including mosmodel), can be found here.
Mosaic of pages