|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-04-10 16:59 UTC] jim at bladehq dot com
[2012-04-11 14:35 UTC] rasmus@php.net
-Status: Open
+Status: Not a bug
[2012-04-11 14:35 UTC] rasmus@php.net
[2012-04-18 20:56 UTC] philip@php.net
[2012-04-18 20:56 UTC] philip@php.net
-Status: Not a bug
+Status: Re-Opened
-Type: Bug
+Type: Documentation Problem
-Assigned To:
+Assigned To: philip
[2012-04-18 21:03 UTC] philip@php.net
[2012-04-18 21:19 UTC] philip@php.net
[2012-06-01 06:48 UTC] philip@php.net
-Status: Re-Opened
+Status: Closed
[2012-06-01 06:48 UTC] philip@php.net
[2012-12-07 10:01 UTC] keith at sauvant dot de
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 16:00:01 2025 UTC |
Description: ------------ Fetching data through mysql_fetch_assoc() causes php memory usage to go up after each query. This occurs even after unsetting the retrieved data. Test script: --------------- <?php $db = mysql_connect(DB_DOMAIN, DB_USERNAME, DB_PASS, true); echo "Start Memory : ".memory_get_usage()."\n"; $result = mysql_query('SELECT * FROM addr', $db); for ($i = 0; $i < 10; $i++) { $row = mysql_fetch_assoc($result); if ($row === false) break; unset($row); gc_collect_cycles(); echo " ".memory_get_usage()."\n"; } mysql_free_result($result); echo "End Memory : ".memory_get_usage()."\n"; ?> Expected result: ---------------- Memory usage should be similar after each execution Start Memory : 31108008 65407576 65407576 65407576 65407576 65407576 65407576 65407576 65407576 65407576 65407576 End Memory : 31108160 Actual result: -------------- Memory usage increases significantly after each execution Start Memory : 31108008 65407576 65408120 65408664 65409208 65409752 65410296 65410840 65411384 65411944 65412488 End Memory : 31108160