|
Actually, it's a compile time option. The default is to use the internal slab allocator. You really really want to use the built-in slab allocator. At first memcached did just use malloc/free for everything. However this does not play very well with OS memory managers. You get fragmentation, and your OS ends up spending more time trying to find contiguous blocks of memory to feed malloc() than it does running the memcached process. If you disagree, of course you're free to try malloc! just don't complain on the lists ;) The slab allocator was built to work around this. buy viagra online --> Memory is allocated in chunks internally and constantly reused. Since memory is broken into different size slabs, you do waste memory if your items do not fit perfectly into the slab the server chooses to put it in. This has enjoyed considerable efficiency improvements by Steven Grimm.
more
|
How does memcached's memory allocation work? Why not use malloc/free!? Why the hell does it use slabs!?
Related Questions
- The cache structure is an LRU (Least Recently Used), plus expiration timeouts. When you store items into ...
- It doesn't! Memcached is the soft, doughy underbelly of your application. Part of what makes the clients and ...
- Under the segmented architecture of PC compatibles, it can be difficult to use more than 640K with any degree ...
- ftp://ftp.digital.com/pub/misc/malloc_dbg. If you get the package, be sure to read the stuff in the file ...
- Under the segmented architecture of PC compatibles, it can be difficult to use more than 640K with any degree ...