[Issues] [apr_memcache 0000068]: memory leaks in apr_memcache_getp
issues at outoforder.cc
issues at outoforder.cc
Fri Apr 6 11:30:43 EDT 2007
A NOTE has been added to this issue.
======================================================================
http://issues.outoforder.cc/view.php?id=68
======================================================================
Reported By: yangluo
Assigned To:
======================================================================
Project: apr_memcache
Issue ID: 68
Category: Error Handling
Reproducibility: always
Severity: major
Priority: normal
Status: new
======================================================================
Date Submitted: 12-30-2006 03:12 EST
Last Modified: 04-06-2007 11:30 EDT
======================================================================
Summary: memory leaks in apr_memcache_getp
Description:
When I was testing apr_memcache with my program I found it was using more
and more memory.
My code is just like the official example with a big loop calling
apr_memcache_getp().
The source code is attached.
======================================================================
----------------------------------------------------------------------
michelnok - 04-06-07 11:10
----------------------------------------------------------------------
apr_memcache_getp() MUST allocate memory for data received from Memcached.
It allows to specify in second parameter a SEPARATE pool to allocate
memory for data received. You've specified the same pool as for
apr_memcache_create(), so apr_memcache_getp() allocates memory in the pool
that lives all time the program is run.
----------------------------------------------------------------------
michelnok - 04-06-07 11:30
----------------------------------------------------------------------
BUT even if you specify separate pool for apr_memcache_getp() then
apr_memcache still consume memory from the pool apr_memcache_create() was
called with.
It IS a bug. apr_memcache_getp() isn't supposed to allocate anything in
the pool apr_memcache_create() was called with.
Issue History
Date Modified Username Field Change
======================================================================
12-30-06 03:12 yangluo New Issue
12-30-06 03:12 yangluo File Added: memoryleak.c
04-06-07 11:10 michelnok Note Added: 0000089
04-06-07 11:30 michelnok Note Added: 0000090
======================================================================
More information about the Issues
mailing list