|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-02-11 08:19 UTC] nikic@php.net
-Status: Open
+Status: Feedback
[2019-02-11 08:19 UTC] nikic@php.net
[2019-02-11 09:23 UTC] dylan at php dot waywardrambler dot com
-Status: Feedback
+Status: Open
[2019-02-11 09:23 UTC] dylan at php dot waywardrambler dot com
[2019-02-11 09:38 UTC] nikic@php.net
-Status: Open
+Status: Verified
-Assigned To:
+Assigned To: dmitry
[2019-02-11 09:38 UTC] nikic@php.net
[2019-02-12 08:04 UTC] dmitry@php.net
[2019-02-12 08:04 UTC] dmitry@php.net
-Status: Verified
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 26 03:00:01 2025 UTC |
Description: ------------ Memory leak when running unbuffered queries in PDO with ATTR_EMULATE_PREPARES set to false. Test script: --------------- <?php ini_set('memory_limit', '16M'); $pdo = new PDO('mysql:host=*;dbname=*', '*', '*'); $pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $pdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false); $result = $pdo->query("SELECT * FROM large_table"); foreach ($result as $i => $row) if ($i % 10000 === 0) printf("%10s %10s\n", $i, memory_get_usage()); Expected result: ---------------- consistent memory usage, eg: 0 2097152 10000 2097152 20000 2097152 30000 2097152 40000 2097152 Actual result: -------------- 0 2097152 10000 4194304 20000 8388608 30000 12582912 40000 14680064 Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 16384 bytes) in /php on line 10