Bug #72391 [Com]: Committed memory steadily increasing

From: Date: Wed, 06 Jul 2016 08:12:25 +0000
Subject: Bug #72391 [Com]: Committed memory steadily increasing
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202084@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72391&edit=1

 ID:                 72391
 Comment by:         maroszek at gmx dot net
 Reported by:        rob dot vandermei at gmail dot com
 Summary:            Committed memory steadily increasing
 Status:             Open
 Type:               Bug
 Package:            FPM related
 Operating System:   CentOS 6.8
 PHP Version:        7.0.7
 Block user comment: N
 Private report:     N

 New Comment:

Indeed. This fixes the issue. 

I had to make a change in php.h (Line 259) though. There seems to be an error in the current master.

From:
# if PHP_WIN32

To:
# if defined(PHP_WIN32)

Otherwise MSVC was very unhappy.

Thanks for the fix!


Previous Comments:
------------------------------------------------------------------------
[2016-07-05 11:27:04] laruence@php.net

could be dup to #72476, could you please try the snapshot of php-7.0 branch?

it may already be fixed by this commit: https://github.com/php/php-src/commit/bd74e7d0133493ee4290857ac368f5fbdd278084

thanks

------------------------------------------------------------------------
[2016-07-05 07:52:50] maroszek at gmx dot net

Screenshot:
https://dl.dropboxusercontent.com/u/8356310/memory1.png

------------------------------------------------------------------------
[2016-07-05 07:49:48] maroszek at gmx dot net

I was able to pinpoint the problem to this commit:
https://github.com/php/php-src/commit/e23a41225fc4ea099b88e7fc450459173443d98f

After this commit my virtual memory usage skyrockets :)

I am using this simple piece of code: https://gist.github.com/paresy/b4babb919a86e9764bc4

Visual Studio 2015, Update 2 on Windows 10 x64
I will attach a screenshot of the diag window in a minute

------------------------------------------------------------------------
[2016-07-03 16:32:05] maroszek at gmx dot net

I can verify the issue. 

7.0.5 is working fine
7.0.6+ is leaking lots of memory

The php script can be empty. (I just added php opening tags <?)

I am using PHP as an embed library. Therefore i cannot restart the process and my application dies
quite quickly.

------------------------------------------------------------------------
[2016-06-12 16:43:31] rob dot vandermei at gmail dot com

Description:
------------
Since upgrading to PHP 7.0.7, committed memory keeps increasing until I restart FPM, and then it
begins all over again. 

I found one other person ("canique") reporting something similar after upgrading to 7.0.6:
https://www.dotdeb.org/2016/04/29/php-7-0-6-for-jessie/

"Since upgrading to php 7.0.6 I see memory issues. The committed memory in linux is increasing
all the time. I’m checking this with “cat /proc/meminfo | grep Committed_AS”
To see this bug, it’s important to not restart php-fpm and to have a high max request count in
your php process pool (pm.max_requests). Each time the php child process is quitting, this memory is
of course released. But if those child processes get multiple thousands of requests the committed
memory is steadily increasing."

PHP 7.0.7 (cli) (built: May 25 2016 17:35:28) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

[PHP Modules]
apc
apcu
bz2
calendar
Core
ctype
curl
date
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
readline
Reflection
session
sockets
SPL
sqlite3
standard
tokenizer
Zend OPcache
zlib

[Zend Modules]
Zend OPcache

Installed Packages
php70-php-cli.x86_64                                                          7.0.7-1.el6.remi      
                                                          @remi
php70-php-common.x86_64                                                       7.0.7-1.el6.remi      
                                                          @remi
php70-php-fpm.x86_64                                                          7.0.7-1.el6.remi      
                                                          @remi
php70-php-gd.x86_64                                                           7.0.7-1.el6.remi      
                                                          @remi
php70-php-json.x86_64                                                         7.0.7-1.el6.remi      
                                                          @remi
php70-php-mcrypt.x86_64                                                       7.0.7-1.el6.remi      
                                                          @remi
php70-php-mysqlnd.x86_64                                                      7.0.7-1.el6.remi      
                                                          @remi
php70-php-opcache.x86_64                                                      7.0.7-1.el6.remi      
                                                          @remi
php70-php-pdo.x86_64                                                          7.0.7-1.el6.remi      
                                                          @remi
php70-php-pecl-apcu.x86_64                                                    5.1.5-1.el6.remi      
                                                          @remi
php70-php-pecl-apcu-bc.x86_64                                                 1.0.3-1.el6.remi      
                                                          @remi
php70-runtime.x86_64                                                          1.0-5.el6.remi        
                                                        @remi



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=72391&edit=1


Thread (7 messages)

« previous php.bugs (#202084) next »