Go to the first, previous, next, last section, table of contents.


Virtual Memory

The `vm.c' module implements a simple virtual memory manager. Blocks of storage are named by integers, and swapped to and from disk transparently to the rest of the program. Pragmatically, the module is tuned to the assumption that the set of objects being managed consists of many (tens of thousands to millions) small (tens of bytes) objects, with a working set which is small (a few percent) relative to the size of virtual memory, and reasonably static.

Design decisions driven by the above pragmatics include:

This design is, I hope, fairly immune to pathologically bad behavior, which immunity is more important to me than incrementally better average- or best-case behavior. The design adopted also appears to have near-minimal impact on the design and implementation of the rest of the system.

By the way: `vm.c' should work as a pretty decent compacting memory manager even if you never need to page anything to disk...


Go to the first, previous, next, last section, table of contents.