On 16. juli. 2009, at 12.15, Mike Lambert wrote:


Incidentally, why was "mallinfo" removed from memcache 1.4.0? Even
without it being 64-bit aware, it still provided some useful data that
I wasn't able to get via other means in our 1.2.6 binaries.


I wanted to remove the mallinfo call from memcached because I don't think it belongs in the memcached protocol, but this is something you can get from other tools (like pmap).

Another problem with using mallinfo is that not all memory allocators implements mallinfo. By checking for mallinfo in configure (at least on Solaris) would cause memcached to link with libmalloc, and if you look at the manual page for libmalloc you will find:

DESCRIPTION
     Functions in this library provide routines for memory  allo-
     cation.  These  routines  are space-efficient but have lower
     performance. Their usage can result in  serious  performance
     degradation.

You may think that this wouldn't be a problem because we use our own memory allocator inside memcached, but that's not true. The slab allocator is _only_ used to store the items, and all other memory allocations is done through malloc (hash tables, connection structs and buffers, suffix pool etc).

Cheers,

Trond

Reply via email to