You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by proforg <pr...@maloletka.ru> on 2007/01/31 02:30:03 UTC

apr_memcache memory leak

Hi !
It looks like there is something wrong with apr_memcache memory  
management.
I've found similar bug report at http://issues.outoforder.cc/view.php? 
id=68

Actually it looks like  conn->bb brigade does not return all memory  
to pool on apr_brigade_destroy in memcache_getp (may be I'm wrong)

As for me I've solved this problem by creating new conn->bb brigade  
on each getp request using the pool passed to getp.

     apr_bucket_alloc_t *balloc = apr_bucket_alloc_create(p);
     conn->bb = apr_brigade_create(p, balloc);
     APR_BRIGADE_INSERT_TAIL(conn->bb, apr_bucket_socket_create(conn- 
 >sock, balloc));

as this pool is cleaned on each turn, but this is ugly and does not  
solve problem in general case.



Alexej Besciokov
Email/JID: proforg@maloletka.ru