question on ngx_reset_pool() 'current' pointer not reset
Ravi Chunduru
ravivsn at gmail.com
Fri Jan 17 00:21:12 UTC 2014
Hi Maxim,
Thanks for the reply.
If any module consumes lot of memory, resets and still goes on consume more
memory than earlier we could end up with lots of wasted memory.
You are right that we would not end with current as NULL as long as memory
available.
Thanks,
-Ravi.
On Thu, Jan 16, 2014 at 4:07 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:
> Hello!
>
> On Thu, Jan 16, 2014 at 02:56:53PM -0800, Ravi Chunduru wrote:
>
> > Hi Nginx experts,
> > I am new to nginx and started looking into the code to understand the
> > architecture.
> >
> > Currently, I am looking into nginx pool implementation. I have a question
> > on ngx_reset_pool().
> > It seems to set back 'last' to the location as expected. But why
> 'current'
> > and 'failed' are not reset.
> >
> > Does it not make those memory blocks which are not no more referenced by
> > parsing from 'current' made useless?
>
> It looks like a bug. Mostly harmless though - the
> ngx_reset_pool() is a function introduced specifically to save
> some memory while reading big geo databases. Since introduction
> it's only used in the geo module, and I don't think it's possible
> to hit p->current != pool case there.
>
> --
> Maxim Dounin
> http://nginx.org/
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
--
Ravi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20140116/bc27d3b8/attachment.html>
More information about the nginx-devel
mailing list