|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-06-12 07:36 UTC] andrey@php.net
[2009-06-16 08:31 UTC] bugs dot php dot net at moesen dot nu
[2009-06-20 01:00 UTC] php-bugs at lists dot php dot net
[2009-10-30 12:32 UTC] guenter at grodotzki dot ph
[2009-11-03 09:45 UTC] uw@php.net
[2013-07-22 21:05 UTC] ben at ajmadison dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 04:00:02 2025 UTC |
Description: ------------ PHP 5.3 leaks memory when using the MySQL functions, both through PDO and MySQLi directly. When recompiled without mysqlnd, the same code works fine. ./configure --with-mysql=shared,mysqlnd --with-mysqli=shared,mysqlnd --with-pdo-mysql=shared,mysqlnd [ . . . ] Recompiled today's snapshot without the ',mysqlnd'. Reproduce code: --------------- PDO: $db = new PDO($dsn, $user, $pass); $stmt = $test->prepare('SELECT * FROM tech_eciffOkcab.crawlPriceComp'); $result = $stmt->execute(); while($result && $row = $stmt->fetch(PDO::FETCH_ASSOC)) { echo memory_get_usage(), "\n"; } MySQLi: $db = new MySQLi($host, $user, $pass); $result = $db->query('SELECT * FROM tech_eciffOkcab.crawlPriceComp'); while ($result && $row = $result->fetch_assoc()) { echo memory_get_usage(), "\n"; } Expected result: ---------------- Consistent memory_get_usage(); I.e., no extra memory required, and thus no out-of-memory errors. Actual result: -------------- Linearly increasing memory_get_usage(); PDO: 23168400 23169064 ... 33552804 33552916 -> OOM and segfault. MySQLi: 23168216 23168700 ... 33552812 33552924 -> OOM and segfault.