Probe into memory management of Memcache

Source: Internet
Author: User
Tags prev

Slab Dispenser : http://blog.csdn.net/luotuo44/article/details/42737181

Hash operation : http://blog.csdn.net/luotuo44/article/details/42773231

LRU operation : http://blog.csdn.net/luotuo44/article/details/42869325

configuration Parameters : http://blog.csdn.net/luotuo44/article/details/42672913

Core structural Body

typedef struct _STRITEM {struct _stritem *next;    struct _stritem *prev;    struct _stritem *h_next;       /* Hash Chain Next */rel_time_t time;    /* Least recent Access */rel_time_t exptime;     /* Expire time */int nbytes;    /* Size of data */unsigned short refcount;    uint8_t Nsuffix;   /* Length of flags-and-length String */uint8_t it_flags;       /* item_* above */uint8_t slabs_clsid;/* which slab class we ' re in */uint8_t nkey;     /* Key length, w/terminating null and padding */uint64_t cas_id;    /* The CAS identifier */void * end[]; /* Then null-terminated key */* then "flags length\r\n" (no terminating null) */* then data with terminating \ r      \ n (no terminating null; it ' s binary!) */} item;typedef struct {unsigned int size;   /* Sizes of items */unsigned int perslab;           /* How many items per slab */void **slots;  /* List of item Ptrs */  unsigned int sl_total;   /* Size of previous array */unsigned int sl_curr;         /* First free slot */void *end_page_ptr; /* Pointer to next free item at end of page, or 0 */unsigned int end_page_free;     /* Number of items remaining at end of the last alloced page */unsigned int slabs;       /* How many slabs were allocated for this class */void **slab_list; /* Array of slab pointers */unsigned int list_size;  /* Size of prev array */unsigned int killing; /* index+1 of dying slab, or zero if none */} slabclass_t;

  

Probe into memory management of Memcache

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.