Welcome! Log In Create A New Profile

Advanced

nginx array utility pool usage

Ravi Chunduru
January 16, 2014 09:24PM
Hi Nginx experts,
Thanks for the prompt reply to my earlier email on ngx_reset_pool()

Now, I am looking into ngx_array.c. I found an issue ngx_array_push(). Here
are the details.
nginx will check if number of elements is equal to capacity of the array.
If there is no space in the memory block, it allocates a new memory block
with twice the size of array and copies over the elements. So far so good.
Assume that pool utility got entirely new memory block then a->pool is not
updated with that of 'pool->current'.

I got an assumption from the code that a->pool is always the memory block
that has the array elements by seeing the code in ngx_array_push(),
ngx_array_push_n() or ngx_array_destroy() where checks were always done
with pool pointer in array.

Functionalities issues would come up once there is an array overflow. I
think for every new push of element after first crossing/overflow of the
capacity, nginx will keep on creating new array. Thus it results in wastage
of memory.

Please let me know if its a issue or correct my understanding.

Thanks,
--
Ravi
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

nginx array utility pool usage

Ravi Chunduru 788 January 16, 2014 09:24PM

Re: nginx array utility pool usage

Ravi Chunduru 331 January 16, 2014 09:40PM

Re: nginx array utility pool usage

Maxim Dounin 292 January 16, 2014 09:42PM

Re: nginx array utility pool usage

Ravi Chunduru 299 January 16, 2014 10:18PM

Re: nginx array utility pool usage

Maxim Dounin 345 January 16, 2014 11:06PM

Re: nginx array utility pool usage

Ravi Chunduru 378 January 17, 2014 04:20PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 112
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready