Hello!
On Sat, Aug 3, 2013 at 12:19 AM, Payne Chu wrote:
> 1.) yes I tried both 1.4.1 and 1.4.2 in Homebrew both work fine even with or
> without SSL enabled.
I've just built an nginx 1.4.1 from the official source tarball
(
http://nginx.org/download/nginx-1.4.1.tar.gz ) and I can reproduce
the leak with it (with or without SSL). And I'm getting the leak on
two different Linux x86_64 boxes.
By using a simple systemtap script to trace the leak, and I've quickly
found the following place in the nginx 1.4.1 core is indeed leaking
most of the memory in the global ngx_cycle->pool memory pool:
??:0 posix_memalign
.../nginx-1.4.1/src/os/unix/ngx_alloc.c:59 ngx_memalign
.../nginx-1.4.1/src/core/ngx_palloc.c:185 ngx_palloc_block
.../nginx-1.4.1/src/core/ngx_palloc.c:169 ngx_pnalloc
.../nginx-1.4.1/src/core/ngx_conf_file.c:826 ngx_conf_full_name
.../nginx-1.4.1/src/http/ngx_http_core_module.c:2019
ngx_http_map_uri_to_path
.../nginx-1.4.1/src/http/modules/ngx_http_index_module.c:164
ngx_http_index_handler
.../nginx-1.4.1/src/http/ngx_http_core_module.c:1417
ngx_http_core_content_phase
.../nginx-1.4.1/src/http/ngx_http_core_module.c:890
ngx_http_core_run_phases
.../nginx-1.4.1/src/http/ngx_http_core_module.c:872 ngx_http_handler
So we need to fix the leak in the nginx core.
BTW, I'm using the following systemtap script to trace this leak. One
can also easily port it over to dtrace (for Mac OS X, Solaris, or
FreeBSD):
http://agentzh.org/misc/leaks.stp
I'm not sure why you cannot reproduce it with homebrew installations
of nginx. Could you please re-check your configurations? Because a
leak is definitely there.
Best regards,
-agentzh