|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-04-25 15:10 UTC] jani@php.net
[2009-05-03 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 19 14:00:02 2025 UTC |
Description: ------------ Multiple calls to nextRowset() or closeCursor() (only for PDO drivers that support nextRowset()) greatly increases memory allocation to the script. I've confirmed this problem with PHP 5.2.x and 6. These results are from using PDO_ODBC with MS-SQL 2005. PDO_MYSQL and PDO_SQLITE would return 512 KiB no matter how many SELECT statements are run because they don't support nextRowset(). Reproduce code: --------------- for ($i=0; $i<1000; $i++) { $result = $conn->query('SELECT * FROM foo'); $result->closeCursor(); } $mem = memory_get_peak_usage(true) / 1024; echo $mem; // Following run in a separate script to reset mem usage for ($i=0; $i<100000; $i++) { $result = $conn->query('SELECT * FROM foo'); $result->closeCursor(); } $mem = memory_get_peak_usage(true) / 1024; echo $mem; Expected result: ---------------- 512 512 Actual result: -------------- 1536 111872