I've logged this as issue 29.

  http://code.google.com/p/memcached/issues/detail?id=29

On Mar 17, 10:58 am, "[email protected]" <[email protected]>
wrote:
> From slabs.c:
>             bufcurr += sprintf(bufcurr, "STAT %d:used_chunks %u\r\n",
> i, slabs*perslab - p->sl_curr);
>             bufcurr += sprintf(bufcurr, "STAT %d:free_chunks %u\r\n",
> i, p->sl_curr);
>             bufcurr += sprintf(bufcurr, "STAT %d:free_chunks_end %u\r
> \n", i, p->end_page_free);
>
> so it's an easy patch:
>             bufcurr += sprintf(bufcurr, "STAT %d:used_chunks %u\r\n",
> i, slabs*perslab - p->sl_curr - p->end_page_free);
>
> On Mar 17, 6:41 pm, Dustin <[email protected]> wrote:
>
> > On Mar 17, 9:42 am, "[email protected]" <[email protected]>
> > wrote:
>
> > > Still playing with slabs allocation, I found another strange result.
> > > Storing only one small value in memcached, I end up with this output
> > > for stats slabs:
>
> > > STAT 1:chunk_size 104
> > > STAT 1:chunks_per_page 10082
> > > STAT 1:total_pages 1
> > > STAT 1:total_chunks 10082
> > > STAT 1:used_chunks 10082
> > > STAT 1:free_chunks 0
> > > STAT 1:free_chunks_end 10081
> > > STAT active_slabs 1
> > > STAT total_malloced 1048528
>
> > > It is strange that whereas I store only one value, used_chunks report
> > > 10082. However, after deleting the value, free_chunks increase to 1,
> > > and used_chunks decrease to 10081. Why are chunks in free_chunks_end
> > > also considered as used_chunks ?
>
> >   This kind of looks like a bug to me.  It's not *completely* clear
> > what used_chunks means.  It's documented as "How many chunks have been
> > allocated to items." which could be read as the number of chunks made
> > available to items, but that doesn't make as much as sense as the
> > number of chunks that have actually contained item data since
> > total_chunks kind of encapsulates the former.

Reply via email to