You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jean-Jacques Clar <JJ...@novell.com> on 2002/09/13 00:16:35 UTC
leak in APR
"Memory in Apache never shrinks".
Is this a true statement?
When reaching a cruising state (stable load, same files requested, all
files in cache)
should I see some fluctuation in the APR. allocated memory (going up
and down) OR
should it stay always at the same value?
Should the call to apr_pool_clear(ptrans) at the end of the request
decrease the
memory allocated in APR. or is it just putting that memory back
available in the pool?
Thanks,
JJ
>>> JJCLAR@novell.com 09/12/02 10:14AM >>>
Using the atomic test, we do past all of them.
Is it enough or there are other actions that should be taken?
I ran another test requesting the same single small file (GIF, 223
bytes) from 5 clients
instead of 1. rate is at 275 req/sec.
It looks like it is leaking at a 1 MB/5 min rate.
JJ
>>> bill@wstoddard.com 09/12/02 08:49AM >>>
There is a nasty bit of cruft still left in mod_mem_cache regarding
use
of
the apr_atomic functions. There is a magic macro called USE_ATOMICS
defined
in mod_cache.h that should be turned into an APR feature macro. If the
apr_atomic operators are not implemented properly on Netware, then all
kinds
of bad things might happen...
Bill
> -----Original Message-----
> From: Jean-Jacques Clar [mailto:JJCLAR@novell.com]
> Sent: Thursday, September 12, 2002 10:38 AM
> To: dev@httpd.apache.org
> Subject: Re: memory leak in apr_buck_alloc...
>
>
> I am using WebBench to run my test.
> Request are not using keep alive.
> There are a wide range of files (.ex, .html and .gif and 404s)
> It leaks, whatever if I am requesting only few files or the whole
6000+
> set of files.
> The leak depend on the number of clients I am using, with 40 clients
> and a
> refresh rate of 5 sec., APR memory grows by more than 1 MB/sec.
>
> Thanks,
>
> JJ
>
> >>> brianp@apache.org 09/12/02 12:54AM >>>
> I tried to recreate this problem, but no luck so far...
> is there any particular type of request that I need to
> use to trigger the memory leak? I just ran a few hundred
> thousand requests for the same 1KB file through 2.0.41-pre2
> with the mod_mem_cache settings below, and I can't see
> any sign of memory growth in the httpd yet.
>
> Thanks,
> Brian
>
> On Tue, 2002-09-10 at 14:40, Jean-Jacques Clar wrote:
> > I guess my leak is from a different source.
> > Refreshing files in mod_mem_cache drive up the allocated memory in
> > aprlib.
> > It is consistent and has been there since I started using
mod_cache
> > (3-4 months ago).
> >
> > Justin,
> > Were you using caching modules when you were able to reproduce/fix
> > Brad's leak?
> > What did you do to reproduce it on your Unix box?
> > Could you please try the same settings using mem cache?
> > Here is my config:
> >
> > LoadModule cache_module modules/mod_cach.nlm
> > <IfModule mod_cache.c>
> > CacheMaxExpire 60
> > CacheDefaultExpire 12000000
> > CacheIgnoreCacheControl On
> > # LoadModule disk_cache_module modules/dsk_cach.nlm
> > <IfModule mod_disk_cache.c>
> > CacheRoot sys:/cacheroot
> > CacheSize 256
> > CacheEnable disk /
> > CacheDirLevels 6
> > CacheDirLength 3
> > </IfModule>
> > LoadModule mem_cache_module modules/mem_cach.nlm
> > <IfModule mod_mem_cache.c>
> > CacheEnable mem /
> > MCacheSize 70000
> > MCacheMaxObjectCount 13001
> > MCacheMinObjectSize 1
> > MCacheMaxObjectSize 690000
> > </IfModule>
> > </IfModule>
> >
> > Thanks,
> >
> > Jean-Jacques
> >
> > >>> jerenkrantz@apache.org 09/10/02 02:25PM >>>
> > On Mon, Sep 09, 2002 at 02:41:33PM -0600, Brad Nicholes wrote:
> > > Has anybody else noticed a memory leak when requesting
pages
> > less
> > > than 8k? If I repeatedly request pages less than 8k I have
> noticed
> > > that
> >
> > Yeah, my recent commit to core_output_filter seems to have fixed
> > this for me.
> >
> > We removed the EOS buckets from the brigade, but we never deleted
> > them. In order to be cleaned up with the pool, they have to be
> > in a brigade. An orphan bucket won't be freed. -- justin
>
>
>
Re: leak in APR
Posted by Aaron Bannert <aa...@clove.org>.
On Thu, Sep 12, 2002 at 04:16:35PM -0600, Jean-Jacques Clar wrote:
> "Memory in Apache never shrinks".
> Is this a true statement?
> When reaching a cruising state (stable load, same files requested, all
> files in cache)
> should I see some fluctuation in the APR. allocated memory (going up
> and down) OR
> should it stay always at the same value?
Ideally it will stay about the same, maybe occasionally raising slightly
to accomodate some abnormal conditions.
> Should the call to apr_pool_clear(ptrans) at the end of the request
> decrease the
> memory allocated in APR. or is it just putting that memory back
> available in the pool?
Even if it were calling free() you wouldn't see your allocated memory
decrease (from viewing top or ps output).
-aaron