memory.md 542 B

Memory allocation

Memcache slabs model

  • 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