2017-03-30 11:58:54 |
Vasya Pupkin |
bug |
|
|
added bug |
2017-03-30 14:00:30 |
Vasya Pupkin |
description |
I noticed that php processes do not free memory after killing scripts that are running more than allowed by max_execution_time directive.
My setup is lighttpd with php configured as fcgi. Sample script (requires php-imagick) that can easily hit default 30 seconds time limit and uses a lot of memory so leaks are easy to notice:
<?php
define('__BASE__', 'images');
$photos = [];
if ($album_root = opendir(__BASE__)) {
while (false !== ($entry = readdir($album_root))) {
if (preg_match('/\.(jpe?g|gif|png)$/i', $entry)) {
$photos[] = $entry;
}
}
closedir($album_root);
sort($photos);
foreach($photos as $photo) {
$thumb = 'thumbs/'.$photo;
if (!file_exists($thumb)) {
$image = new \Imagick(realpath(__BASE__.'/'.$photo));
$image->thumbnailImage(64, 48, true, false);
$image->writeImage($thumb);
$image->clear;
$image = null;
}
}
}
?>
Just put many big JPGs to images directory.
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: php7.0-cgi 7.0.15-0ubuntu0.16.04.4
ProcVersionSignature: Ubuntu 4.8.0-45.48~16.04.1-generic 4.8.17
Uname: Linux 4.8.0-45-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.5
Architecture: amd64
Date: Thu Mar 30 14:37:16 2017
InstallationDate: Installed on 2011-04-14 (2177 days ago)
InstallationMedia: Ubuntu-Server 10.04.2 LTS "Lucid Lynx" - Release amd64 (20110211.1)
SourcePackage: php7.0
UpgradeStatus: Upgraded to xenial on 2016-07-30 (242 days ago) |
I noticed that php processes do not free memory after killing scripts that are running more than allowed by max_execution_time directive.
My setup is lighttpd with php configured as fcgi. Sample script (requires php-imagick) that can easily hit default 30 seconds time limit and uses a lot of memory so leaks are easy to notice:
<?php
define('__BASE__', 'images');
$photos = [];
if ($album_root = opendir(__BASE__)) {
while (false !== ($entry = readdir($album_root))) {
if (preg_match('/\.(jpe?g|gif|png)$/i', $entry)) {
$photos[] = $entry;
}
}
closedir($album_root);
sort($photos);
if (!file_exists('thumbs')) {
mkdir('thumbs');
}
foreach($photos as $photo) {
$thumb = 'thumbs/'.$photo;
if (!file_exists($thumb)) {
$image = new \Imagick(realpath(__BASE__.'/'.$photo));
$image->thumbnailImage(64, 48, true, false);
$image->writeImage($thumb);
$image->clear;
$image = null;
}
}
}
?>
Just put many big JPGs to images directory.
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: php7.0-cgi 7.0.15-0ubuntu0.16.04.4
ProcVersionSignature: Ubuntu 4.8.0-45.48~16.04.1-generic 4.8.17
Uname: Linux 4.8.0-45-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.5
Architecture: amd64
Date: Thu Mar 30 14:37:16 2017
InstallationDate: Installed on 2011-04-14 (2177 days ago)
InstallationMedia: Ubuntu-Server 10.04.2 LTS "Lucid Lynx" - Release amd64 (20110211.1)
SourcePackage: php7.0
UpgradeStatus: Upgraded to xenial on 2016-07-30 (242 days ago) |
|
2017-03-31 11:05:13 |
Christian Ehrhardt |
php7.0 (Ubuntu): status |
New |
Incomplete |
|
2017-04-03 14:49:49 |
Christian Ehrhardt |
bug |
|
|
added subscriber ChristianEhrhardt |
2017-04-03 14:49:59 |
Christian Ehrhardt |
bug |
|
|
added subscriber Ubuntu Server Team |
2017-04-05 08:26:14 |
Christian Ehrhardt |
tags |
amd64 apport-bug xenial |
amd64 apport-bug server-next xenial |
|
2017-04-05 11:01:05 |
Christian Ehrhardt |
information type |
Public |
Public Security |
|
2017-04-05 12:02:39 |
Christian Ehrhardt |
php7.0 (Ubuntu): status |
Incomplete |
Confirmed |
|
2017-04-05 12:41:45 |
Christian Ehrhardt |
bug watch added |
|
http://bugs.php.net/bug.php?id=59031 |
|
2017-04-05 12:41:58 |
Christian Ehrhardt |
php7.0 (Ubuntu): status |
Confirmed |
Opinion |
|
2017-04-05 12:58:14 |
Christian Ehrhardt |
tags |
amd64 apport-bug server-next xenial |
amd64 apport-bug xenial |
|
2017-04-05 13:02:35 |
Christian Ehrhardt |
removed subscriber Ubuntu Server Team |
|
|
|
2017-04-05 15:43:42 |
Joshua Powers |
bug |
|
|
added subscriber Joshua Powers |
2017-04-06 07:06:19 |
Christian Ehrhardt |
php7.0 (Ubuntu): status |
Opinion |
Confirmed |
|
2017-04-06 08:05:09 |
Christian Ehrhardt |
tags |
amd64 apport-bug xenial |
amd64 apport-bug server-next xenial |
|
2017-04-06 08:05:17 |
Christian Ehrhardt |
bug |
|
|
added subscriber Ubuntu Server Team |
2017-04-06 08:05:23 |
Christian Ehrhardt |
php7.0 (Ubuntu): assignee |
|
Nish Aravamudan (nacc) |
|
2017-04-06 17:12:23 |
Vasya Pupkin |
bug watch added |
|
http://bugs.php.net/bug.php?id=74387 |
|
2017-04-06 21:31:57 |
Alberto Salvia Novella |
php7.0 (Ubuntu): importance |
Undecided |
High |
|
2017-04-25 22:40:57 |
Nish Aravamudan |
bug task added |
|
php-imagick (Ubuntu) |
|
2017-04-25 22:41:21 |
Nish Aravamudan |
php7.0 (Ubuntu): status |
Confirmed |
Invalid |
|
2017-04-25 22:41:27 |
Nish Aravamudan |
php7.0 (Ubuntu): assignee |
Nish Aravamudan (nacc) |
|
|
2017-05-05 13:28:41 |
Marc Deslauriers |
php-imagick (Ubuntu): status |
New |
Confirmed |
|
2019-02-19 17:32:44 |
Andreas Hasenack |
tags |
amd64 apport-bug server-next xenial |
amd64 apport-bug xenial |
|
2021-03-14 21:52:57 |
Logan Rosen |
bug task added |
|
php |
|
2022-02-07 23:15:21 |
Bryce Harrington |
affects |
php-imagick (Ubuntu) |
imagemagick (Ubuntu) |
|
2022-02-07 23:15:21 |
Bryce Harrington |
imagemagick (Ubuntu): status |
Confirmed |
Incomplete |
|