storage_memory.md 823 B

Memory allocation

Level zero: Go native

  • In this early model, storage uses Go native objects and storage instead of building its own.
  • This is only to build an operational app structure.

Level one: in-app

Very likely to be needed once the app structure is operational.

Reference

Memcache slabs allocator

  • http://www.mikeperham.com/2009/06/22/slabs-pages-chunks-and-memcached/ (2009)
    • Older versions of memcached used slabs sized based on powers of two, so you'd have a 1KB slab, 2KB slab, 4KB slab, ..., all the way to 1MB.
    • Newer (2006: 1.2.0-RC1 ?) versions use 1.25^n for the chunk size
  • Allocate slabs for elements of a given size range ("chunks")
  • Slabs are made of fixed-size (1MB) pages, split according to the chunk size
  • Slab chunk sizes are in a geometric progression: (1 + x)^n