comparison src/core/ngx_slab.h @ 5718:c46657e391a3

Core: slab allocator free pages defragmentation. Large allocations from a slab pool result in free page blocks being fragmented, eventually leading to a situation when no further allocation larger than a page size are possible from the pool. While this isn't a problem for nginx itself, it is known to be bad for various 3rd party modules. Fix is to merge adjacent blocks of free pages in the ngx_slab_free_pages() function. Prodded by Wandenberg Peixoto and Yichun Zhang.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 03 Jun 2014 17:53:03 +0400
parents 5024d29354f1
children 25ade23cf281
comparison
equal deleted inserted replaced
5717:efc84a5723b3 5718:c46657e391a3
27 27
28 size_t min_size; 28 size_t min_size;
29 size_t min_shift; 29 size_t min_shift;
30 30
31 ngx_slab_page_t *pages; 31 ngx_slab_page_t *pages;
32 ngx_slab_page_t *last;
32 ngx_slab_page_t free; 33 ngx_slab_page_t free;
33 34
34 u_char *start; 35 u_char *start;
35 u_char *end; 36 u_char *end;
36 37