Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

memory pool allocation (no replies)

$
0
0
Suppose, I am allocating a pool of greater than 4k(page size). Say for example I am calling the function ngx_create_pool with 8096.
But, this function will set the max as 4095 even if it has allocated 8K. Not sure, why is it being done like this.


p->max = (size < NGX_MAX_ALLOC_FROM_POOL) ? size : NGX_MAX_ALLOC_FROM_POOL;


I know, I have created a pool with size 8K, now I am allocating say 4K (4096) from this pool. I will call ngx_palloc with 4096. There we check if (size <= pool->max) which in this case will not satisfy and it will go and call ngx_palloc_large which inturn will allocate 4K.

This somehow is not sounding good. Why is ngx_create_pool putting a max value of page size even when it is allocating more. It is not doing chaining also.

Any expert opinions???

Thanks, Santos

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>