Memory issue in apache modules

2007-12-14 Thread John Zhang
When my module processes requests, I see a consistent
memory increase.  It is like the memories were never
released.  I am using the apr_* functions to allocate
memory (most of the time from the request->pool).  My
understanding is that memories will be reclaimed by
apache after the request is processed (so I do not
need to free/delete).  Anyone has any ideas?  Does
this have anything to do with keep alive?

Thanks,
John


Re: Memory issue in apache modules

2007-12-14 Thread Eric Covener
On Dec 14, 2007 6:05 PM, John Zhang <[EMAIL PROTECTED]> wrote:
> When my module processes requests, I see a consistent
> memory increase.  It is like the memories were never
> released.  I am using the apr_* functions to allocate
> memory (most of the time from the request->pool).  My
> understanding is that memories will be reclaimed by
> apache after the request is processed (so I do not
> need to free/delete).  Anyone has any ideas?  Does
> this have anything to do with keep alive?

It should level out as each thread in the process has had a chance to
run and allocate some memory for a range of requests.  MaxMemFree can
be used to return the heap memory that would otherwise be used by
subsequent requests on that thread.


-- 
Eric Covener
[EMAIL PROTECTED]


Re: Memory issue in apache modules

2007-12-14 Thread John Zhang

--- Eric Covener <[EMAIL PROTECTED]> wrote:
> 
> It should level out as each thread in the process
> has had a chance to
> run and allocate some memory for a range of
> requests.  MaxMemFree can
> be used to return the heap memory that would
> otherwise be used by
> subsequent requests on that thread.
> 
Thanks Eric,
But I see consistent memory increase when I load
the SAME page repeatedly.  So something is wrong with
my module.  But I do not know what.

Thanks again.
John


Re: Memory issue in apache modules

2007-12-14 Thread Ray Morris

I am using the apr_* functions to allocate
memory (most of the time from the request->pool).


  If there are few places where you allocate from
othr than the reqquest pool, I'd look at those first.
--
Ray B. Morris
[EMAIL PROTECTED]

Strongbox - The next generation in site security:
http://www.bettercgi.com/strongbox/





On 12/14/2007 05:05:24 PM, John Zhang wrote:

When my module processes requests, I see a consistent
memory increase.  It is like the memories were never
released.  I am using the apr_* functions to allocate
memory (most of the time from the request->pool).  My
understanding is that memories will be reclaimed by
apache after the request is processed (so I do not
need to free/delete).  Anyone has any ideas?  Does
this have anything to do with keep alive?

Thanks,
John



Re: Memory issue in apache modules

2007-12-17 Thread Joe Lewis
John Zhang wrote:
> --- Ray Morris <[EMAIL PROTECTED]> wrote:
>
>   
>>> I am using the apr_* functions to allocate
>>> memory (most of the time from the request->pool).
>>>   
>>If there are few places where you allocate from
>> othr than the reqquest pool, I'd look at those
>> first.
>> 
>
> I used the bucket/brigade for my data that requires
> the use of request->connection->bucket_alloc.  I read
> a very old post stating that when keep alive is on
> (which is true in my case), then the memory associated
> with the connection will not be freed?  But no answer
> to that post.  Is that a valid concern?

That is a valid concern.  Unfortunately, I do not have an answer to
that, as I have not dug into the apache code itself.  I apologize that I
cannot contribute to an answer in this particular case.

> If so , how
> can I reclaim the connection-related memory or use a
> different memory pool?
>   

Your buckets can still be created using the request->pool .  My created
buckets in my output filter are done that way.  Have you tried it?  You
still use the request->connection->bucket_alloc for the other parameter,
but the request->pool for the memory pool to be used.

Joe
-- 
Joseph Lewis 
"Divide the fire, and you will sooner put it out." - Publius Syrus


Re: Memory issue in apache modules

2007-12-17 Thread John Zhang

--- Joe Lewis <[EMAIL PROTECTED]> wrote:
> Your buckets can still be created using the
> request->pool .  My created
> buckets in my output filter are done that way.  Have
> you tried it?  You
> still use the request->connection->bucket_alloc for
> the other parameter,
> but the request->pool for the memory pool to be
> used.
Thanks Joe!