|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-03-15 16:50 UTC] data dot protection dot gdpr at gmail dot com
[2019-03-22 12:15 UTC] nikic@php.net
-Status: Open
+Status: Duplicate
[2019-03-22 12:15 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
Description: ------------ In PHP 7.2, this was running very well. Since the upgrade to PHP 7.3, very quickly I get a "memory exhausted" error in the mysqli_fetch_assoc() call, at around result #850000. Increasing "memory_limit" helps getting more results, but the error is always on mysqli_fetch_assoc(), so I'm very confident the problem is there. The data retrieved by the SELECT is very small (no big blobs), so there is no bad row that I'm hitting that causes the memory issue. Isn't the point of "use_result" not putting everything in memory and being able to go through huge amount of results? Am I doing something wrong? Is there a way to flush the previous read results? Test script: --------------- mysqli_real_query($conn, 'SELECT id, name FROM big_table WHERE ... ORDER BY ... LIMIT 1500000); $result = mysqli_use_result($conn); <... error handling here ...> while ($row = mysqli_fetch_assoc($result)) { <... do stuff ...> } mysqli_free_result($result);