# Memory leaks on nginx / php-fpm

**URL:** <https://www.ruby-forum.com/t/memory-leaks-on-nginx-php-fpm/211696>\
**Category:** NGINX\
**Created:** [September 11, 2011, 10:28am UTC](https://www.ruby-forum.com/t/memory-leaks-on-nginx-php-fpm/211696 "2011-09-11T10:28:39Z")\
**Posts on this page:** 4\
**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:** [September 11, 2011, 10:28am UTC](https://www.ruby-forum.com/t/memory-leaks-on-nginx-php-fpm/211696/1 "2011-09-11T10:28:39Z")

</div>

hi guys,

i have a serious problem that i can’t make nor heads nor tails of. i am  
using nginx 1.0.6 with php 5.2.17 + fpm.

i run a gallery2 image gallery, pretty busy, and when i redirected some  
traffic from the old server today to the new one, i got a bunch of  
memory leaks messages in the php-fpm log. they are going like crazy  
filling up the log.

can you please give me some advice?

thanks in advance.

Sep 11 01:24:29.948540 [WARNING] fpm\_stdio\_child\_said(), line 167: child  
22682 (pool default) said into stderr:  
“/usr/ports/lang/php52/work/php-5.2.17/Zend/zend\_variables.c(131) :  
Actual location (location was relayed)”  
Sep 11 01:24:29.948583 [WARNING] fpm\_stdio\_child\_said(), line 167: child  
22682 (pool default) said into stderr: “Last leak repeated 2 times”  
Sep 11 01:24:29.948591 [WARNING] fpm\_stdio\_child\_said(), line 167: child  
22682 (pool default) said into stderr: “[Sun Sep 11 01:24:29 2011]  
Script: ‘/home/cityv3/public\_html/gallery/main.php’”  
Sep 11 01:24:29.948597 [WARNING] fpm\_stdio\_child\_said(), line 167: child  
22682 (pool default) said into stderr:  
“/usr/ports/lang/php52/work/php-5.2.17/Zend/zend\_variables.c(132) :  
Freeing 0x80C269680 (512 bytes),  
script=/home/cityv3/public\_html/gallery/main.php”  
Sep 11 01:24:29.948603 [WARNING] fpm\_stdio\_child\_said(), line 167: child  
22682 (pool default) said into stderr:  
“/usr/ports/lang/php52/work/php-5.2.17/Zend/zend\_alloc.c(2391) : Actual  
location (location was relayed)”  
Sep 11 01:24:29.948637 [WARNING] fpm\_stdio\_child\_said(), line 167: child  
22682 (pool default) said into stderr: “Last leak repeated 2 times”  
Sep 11 01:24:29.948644 [WARNING] fpm\_stdio\_child\_said(), line 167: child  
22682 (pool default) said into stderr: “[Sun Sep 11 01:24:29 2011]  
Script: ‘/home/cityv3/public\_html/gallery/main.php’”  
Sep 11 01:24:29.948650 [WARNING] fpm\_stdio\_child\_said(), line 167: child  
22682 (pool default) said into stderr:  
“/usr/ports/lang/php52/work/php-5.2.17/Zend/zend\_vm\_execute.h(7535) :  
Freeing 0x80C26CF78 (24 bytes),  
script=/home/cityv3/public\_html/gallery/main.php”  
Sep 11 01:24:29.948693 [WARNING] fpm\_stdio\_child\_said(), line 167: child  
22682 (pool default) said into stderr: “[Sun Sep 11 01:24:29 2011]  
Script: ‘/home/cityv3/public\_html/gallery/main.php’”  
Sep 11 01:24:29.948699 [WARNING] fpm\_stdio\_child\_said(), line 167: child  
22682 (pool default) said into stderr:  
“/usr/ports/lang/php52/work/php-5.2.17/ext/standard/string.c(756) :  
Freeing 0x80C26D270 (6 bytes),  
script=/home/cityv3/public\_html/gallery/main.php”

---

<div class="post-metadata">

**Author:** ![Stefanita\_Rares\_Dum](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/71c47a/32.png) [@Stefanita\_Rares\_Dum](https://www.ruby-forum.com/u/Stefanita_Rares_Dum)\
**Post date:** [September 11, 2011, 1:20pm UTC](https://www.ruby-forum.com/t/memory-leaks-on-nginx-php-fpm/211696/2 "2011-09-11T13:20:36Z")

</div>

You will want to bring this up to the PHP people as there is no link  
between Nginx and PHP-FPM. There is a fastcgi abstraction layer between  
them. That said, they have deprecated PHP 5.2.x and PHP-FPM for 5.2.x is  
a patch so I honestly think you’ll be told to upgrade first and then see  
what happens, so you might want to do that first.

Posted at Nginx Forum:

> **[Re: memory leaks on nginx / php-fpm](https://forum.nginx.org/read.php?2,215080,215085#msg-215085)**
>
> hi guys, i have a serious problem that i can't make nor heads nor tails of. i am using nginx 1.0.6 with php 5.2.17 + fpm. i run a gallery2 image gallery, pretty busy, and when i redirected some traffic from the old server today to the new one, i got...

---

<div class="post-metadata">

**Author:** ![Stefanita\_Rares\_Dum](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/71c47a/32.png) [@Stefanita\_Rares\_Dum](https://www.ruby-forum.com/u/Stefanita_Rares_Dum)\
**Post date:** [September 11, 2011, 3:42pm UTC](https://www.ruby-forum.com/t/memory-leaks-on-nginx-php-fpm/211696/3 "2011-09-11T15:42:42Z")

</div>

fixed by disabling the apc extension. i have no clue how that got  
installed as i did not build it. it was conflicting with the installed  
eaccelerator. weird stuff.

---

<div class="post-metadata">

**Author:** ![Stefanita\_Rares\_Dum](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/71c47a/32.png) [@Stefanita\_Rares\_Dum](https://www.ruby-forum.com/u/Stefanita_Rares_Dum)\
**Post date:** [September 11, 2011, 6:48pm UTC](https://www.ruby-forum.com/t/memory-leaks-on-nginx-php-fpm/211696/4 "2011-09-11T18:48:34Z")

</div>

FYI: last version of APC (3.1.9) fixed some memory leaks with FastCGI,  
I have no issues with php-fpm 5.3.8 and APC 3.1.9

another recomendation - switch to PHP 5.3 if you can, 5.2 branch is not  
supported anymore, and php-fpm SAPI is now bundled into main PHP (5.3),  
works fine, just pay attention that config file is not XML anymore.

Posted at Nginx Forum:

> **[Re: memory leaks on nginx / php-fpm](https://forum.nginx.org/read.php?2,215080,215091#msg-215091)**
>
> hi guys, i have a serious problem that i can't make nor heads nor tails of. i am using nginx 1.0.6 with php 5.2.17 + fpm. i run a gallery2 image gallery, pretty busy, and when i redirected some traffic from the old server today to the new one, i got...
