You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Yehezkel Horowitz <ho...@checkpoint.com> on 2011/05/24 14:20:13 UTC

[PR #51256] Memory consumption by parent process at sort_hook function

I have noticed that sort_hook function (in apr_hooks.c) doesn't destroy temporary pool.



This leads to a memory consumption of ~500K (=68 hooks * 8K) per PROCESS!



Since the sorted hooks are memcpy'ed to another pool anyway, no one needs this pool after the function return.



So the resolution is very simple - destroy this pool after usage (before returning the sorted hooks array).



I have tested this solution in my environment, without any problems.



What do you think about this?

Regards,

Yehezkel

RE: [PR #51256] Memory consumption by parent process at sort_hook function

Posted by Yehezkel Horowitz <ho...@checkpoint.com>.
The patch is attached to the PR.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51256

Yehezkel

________________________________
From: Graham Leggett [mailto:minfrin@sharp.fm]
Sent: Tuesday, May 24, 2011 4:06 PM
To: dev@httpd.apache.org
Subject: Re: [PR #51256] Memory consumption by parent process at sort_hook function

On 24 May 2011, at 2:20 PM, Yehezkel Horowitz wrote:



I have noticed that sort_hook function (in apr_hooks.c) doesn't destroy temporary pool.



This leads to a memory consumption of ~500K (=68 hooks * 8K) per PROCESS!



Since the sorted hooks are memcpy'ed to another pool anyway, no one needs this pool after the function return.



So the resolution is very simple - destroy this pool after usage (before returning the sorted hooks array).



I have tested this solution in my environment, without any problems.



What do you think about this?

Definitely sounds sensible. Do you have a patch so we can take a look?

Regards,
Graham
--


Re: [PR #51256] Memory consumption by parent process at sort_hook function

Posted by Graham Leggett <mi...@sharp.fm>.
On 24 May 2011, at 2:20 PM, Yehezkel Horowitz wrote:

> I have noticed that sort_hook function (in apr_hooks.c) doesn't  
> destroy temporary pool.
>
> This leads to a memory consumption of ~500K (=68 hooks * 8K) per  
> PROCESS!
>
> Since the sorted hooks are memcpy'ed to another pool anyway, no one  
> needs this pool after the function return.
>
> So the resolution is very simple - destroy this pool after usage  
> (before returning the sorted hooks array).
>
> I have tested this solution in my environment, without any problems.
>
> What do you think about this?

Definitely sounds sensible. Do you have a patch so we can take a look?

Regards,
Graham
--