apr_memcache client memory usage

Philip M. Gollucci philip at ridecharge.com
Tue Oct 16 01:17:12 UTC 2007

André Cruz wrote:
> Hello.
> I'm having some memory related problems in a long running daemon that
> uses the apr_memcache client to talk to a memcache server. Basically 
> the daemon uses up all the memory available in the machine after a
> few months of usage. :) Using valgrind I was able to pinpoint the
> guilty party which seems to be apr_memcache and it's use of the apr
> pools.
> I normally create an apr pool which I pass to
> apr_memcache_server_create() and then create sub-pools each time i do
> a getp and destroy them afterwards. But it seems that with each get
> the main pool is used also and this pool I can't destroy on each
> iteration since I would have to create the server objects again.
AFAIK, you should create a sub pool first and pass that to the function.

More information about the memcached mailing list