Core: trim malloc memory after deleting a configuration.

This commit is contained in:
Roman Arutyunyan 2025-06-13 17:25:20 +04:00
parent 890691a088
commit f6b2758734
2 changed files with 14 additions and 0 deletions

View file

@ -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

View file

@ -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) {