mirror of
https://github.com/nginx/nginx.git
synced 2026-02-03 20:29:27 -05:00
Core: trim malloc memory after deleting a configuration.
This commit is contained in:
parent
890691a088
commit
f6b2758734
2 changed files with 14 additions and 0 deletions
10
auto/unix
10
auto/unix
|
|
@ -833,6 +833,16 @@ ngx_feature_test="void *p; p = memalign(4096, 4096);
|
|||
. auto/feature
|
||||
|
||||
|
||||
ngx_feature="malloc_trim()"
|
||||
ngx_feature_name="NGX_HAVE_MALLOC_TRIM"
|
||||
ngx_feature_run=no
|
||||
ngx_feature_incs="#include <malloc.h>"
|
||||
ngx_feature_path=
|
||||
ngx_feature_libs=
|
||||
ngx_feature_test="malloc_trim(0)"
|
||||
. auto/feature
|
||||
|
||||
|
||||
ngx_feature="mmap(MAP_ANON|MAP_SHARED)"
|
||||
ngx_feature_name="NGX_HAVE_MAP_ANON"
|
||||
ngx_feature_run=yes
|
||||
|
|
|
|||
|
|
@ -1325,6 +1325,10 @@ ngx_master_thread_cycle(ngx_cycle_t *cycle)
|
|||
ngx_destroy_pool(first_cycle->pool);
|
||||
|
||||
first_cycle = next_cycle;
|
||||
|
||||
#if (NGX_HAVE_MALLOC_TRIM)
|
||||
malloc_trim(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (first_cycle == cycle) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue