|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-03-06 19:03 UTC] hello at spaceemotion dot net
-Status: Open
+Status: Closed
-PHP Version: 7.2Git-2018-03-05 (snap)
+PHP Version: 7.2.2
[2018-03-06 19:03 UTC] hello at spaceemotion dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 06:00:01 2025 UTC |
Description: ------------ I've just come across an out of memory issue in a larger CLI-command that does lots calculations across multiple tables. The command ran fine on 7.1.x but errors on 7.2.2. I've nailed it down to the PDOStatement class (using Blackfire.io) sometimes creating 26 kb garbage _per call_. The attached test script should not create any garbage whatsoever, and even the gc_collect_cycles call does not reduce the memory footprint. Everything works when running it under 7.1. Opcache is disabled (for CLI). Test script: --------------- <?php $dsn = 'mysql:dbname=homestead;host=127.0.0.1'; $user = 'homestead'; $password = 'secret'; $pdo = new PDO($dsn, $user, $password); for($i = 0; $i < 1000000; $i++) { echo memory_get_usage() . "\n"; $statement = $pdo->prepare('SELECT * FROM demo'); $statement->execute(); gc_collect_cycles(); // does not help as well } Expected result: ---------------- 362504 107678504 107678504 107678504 107678504 107678504 107678504 107678504 Actual result: -------------- 574888 100246184 100246312 100246440 100246568 100246696 100246824 100246952