You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Pravesh Rai <pr...@gmail.com> on 2010/09/01 13:12:13 UTC

[users@httpd] Issue with APR APIs

Hi,

Observed that, if we use following set of functions:

subrequest = ap_sub_req_lookup_uri( webapp->sChpUrl, r, r->output_filters );
ap_run_sub_req( subrequest );
ap_rflush( subrequest );
ap_destroy_sub_req( subrequest );

in a thread [using CreateThread() on Windows OS], every execution of these,
left some Private Bytes consumed. i.e. Memory Leaks. Do anybody has any clue
on this ?

Thanks,
PR

Re: [users@httpd] Issue with APR APIs

Posted by Pravesh Rai <pr...@gmail.com>.
Even we thought of this (using apr_thread_create) initially, but later
realized that we can't achive time-bound functionality with this, similar to
what we've in Windows - WaitForSingleObject().

Thanks,
PR

On Thu, Sep 2, 2010 at 3:23 AM, William A. Rowe Jr. <wr...@rowe-clan.net>wrote:

>  On 9/1/2010 6:12 AM, Pravesh Rai wrote:
> > Hi,
> >
> > Observed that, if we use following set of functions:
> >
> > subrequest = ap_sub_req_lookup_uri( webapp->sChpUrl, r, r->output_filters
> );
> > ap_run_sub_req( subrequest );
> > ap_rflush( subrequest );
> > ap_destroy_sub_req( subrequest );
> >
> > in a thread [using CreateThread() on Windows OS], every execution of
> these, left some
> > Private Bytes consumed. i.e. Memory Leaks. Do anybody has any clue on
> this ?
>
> Why would you be using CreateThread()?  You've mixed your apples and
> oranges.
>
> If you expect apr/httpd to have any chance, you would first use
> apr_thread_create,
> and be certain to apr_thread_join all of the completed threads.  Still no
> guarantee
> that there are no leaks in this scenario, as msvcr may be creating per
> thread
> objects.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] Issue with APR APIs

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 9/1/2010 6:12 AM, Pravesh Rai wrote:
> Hi,
>  
> Observed that, if we use following set of functions:
> 
> subrequest = ap_sub_req_lookup_uri( webapp->sChpUrl, r, r->output_filters );
> ap_run_sub_req( subrequest );
> ap_rflush( subrequest );
> ap_destroy_sub_req( subrequest );
> 
> in a thread [using CreateThread() on Windows OS], every execution of these, left some
> Private Bytes consumed. i.e. Memory Leaks. Do anybody has any clue on this ?

Why would you be using CreateThread()?  You've mixed your apples and oranges.

If you expect apr/httpd to have any chance, you would first use apr_thread_create,
and be certain to apr_thread_join all of the completed threads.  Still no guarantee
that there are no leaks in this scenario, as msvcr may be creating per thread
objects.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Issue with APR APIs

Posted by Nick Kew <ni...@webthing.com>.
On Wed, 1 Sep 2010 16:42:13 +0530
Pravesh Rai <pr...@gmail.com> wrote:

> Hi,
> 
> Observed that, if we use following set of functions:
> 
> subrequest = ap_sub_req_lookup_uri( webapp->sChpUrl, r, r->output_filters );
> ap_run_sub_req( subrequest );
> ap_rflush( subrequest );
> ap_destroy_sub_req( subrequest );
> 
> in a thread [using CreateThread() on Windows OS], every execution of these,
> left some Private Bytes consumed. i.e. Memory Leaks. Do anybody has any clue
> on this ?

Are you looking for bugs in your application or suspecting bugs in Apache?
And what tool is reporting your memory use?

There are parts of the subrequest that can't be destroyed until the main
request is completed, because they may be needed by the main request.
For example, response headers.  Or data on the output chain, which may
be buffered.

What happens when the main request terminates?

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org