# Possible memory leak nginx 1.1.12 with pcre and jit enabled

**URL:** <https://www.ruby-forum.com/t/possible-memory-leak-nginx-1-1-12-with-pcre-and-jit-enabled/216077>\
**Category:** NGINX\
**Created:** [January 24, 2012, 7:13pm UTC](https://www.ruby-forum.com/t/possible-memory-leak-nginx-1-1-12-with-pcre-and-jit-enabled/216077 "2012-01-24T19:13:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [January 24, 2012, 7:13pm UTC](https://www.ruby-forum.com/t/possible-memory-leak-nginx-1-1-12-with-pcre-and-jit-enabled/216077/1 "2012-01-24T19:13:24Z")

</div>

Hi all.

I compiled nginx against pcre 8.21 and jit enabled. With this scenario  
in a few days the nginx processes are using more than 100MiB of RAM  
each. The same scenario with nginx 1.1.12 compiled against the system  
pcre library and jit disable (not available) the nginx processes are  
not consuming more than 13MiB each (as expected).

CentOS 6.x  
nginx 1.1.12  
./configure --with-pcre=…/pcre-8.21/ --with-pcre-jit  
–with-http\_stub\_status\_module --with-http\_ssl\_module  
–without-select\_module --without-http\_ssi\_module  
–without-http\_userid\_module --without-poll\_module  
–without-http\_ssi\_module --without-http\_autoindex\_module  
–without-http\_geo\_module --without-http\_map\_module  
–without-http\_split\_clients\_module --without-http\_referer\_module  
–without-http\_uwsgi\_module --without-http\_scgi\_module  
–without-http\_memcached\_module --without-http\_limit\_conn\_module  
–without-http\_limit\_req\_module --without-http\_browser\_module  
–without-http\_upstream\_ip\_hash\_module --without-http-cache  
–without-mail\_pop3\_module --without-mail\_imap\_module  
–without-mail\_smtp\_module

I’m not sure if the memory leak is related to nginx, pcre,  
configuration or a mix. Please let me know if more information is  
needed, configuration files, etc.

Thanks in advanced.  
Kind Regards.

---

<div class="post-metadata">

**Author:** ![dcarneiro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e36b37/32.png) [@dcarneiro](https://www.ruby-forum.com/u/dcarneiro)\
**Post date:** [January 24, 2012, 8:18pm UTC](https://www.ruby-forum.com/t/possible-memory-leak-nginx-1-1-12-with-pcre-and-jit-enabled/216077/2 "2012-01-24T20:18:27Z")

</div>

On Tuesday 24 January 2012 22:12:07 Daniel C. wrote:

> ./configure --with-pcre=../pcre-8.21/ --with-pcre-jit  
> –without-mail\_pop3\_module --without-mail\_imap\_module  
> –without-mail\_smtp\_module
> 
> I’m not sure if the memory leak is related to nginx, pcre,  
> configuration or a mix. Please let me know if more information is  
> needed, configuration files, etc.

Yes, please, provide your nginx config.

Which version is your system PCRE library? Does it leak when the  
“pcre\_jit”  
directive is switched off?

wbr, Valentin V. Bartenev

---

<div class="post-metadata">

**Author:** ![dcarneiro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e36b37/32.png) [@dcarneiro](https://www.ruby-forum.com/u/dcarneiro)\
**Post date:** [January 27, 2012, 12:34pm UTC](https://www.ruby-forum.com/t/possible-memory-leak-nginx-1-1-12-with-pcre-and-jit-enabled/216077/3 "2012-01-27T12:34:52Z")

</div>

2012/1/24 Valentin V. Bartenev [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> > nginx 1.1.12  
> > –without-http\_upstream\_ip\_hash\_module --without-http-cache  
> > Which version is your system PCRE library? Does it leak when the “pcre\_jit”  
> > directive is switched off?

Just for update. I sent my configuration privately to Valentin, and he  
found a memory leak, he wrote a patch that works as expected, so I  
think that will be fixed in 1.1.14.

Thanks so much to Valentin.

Kind regards.
