ID: 42891 Updated by: [EMAIL PROTECTED] Reported By: windeler at mediafinanz dot de -Status: Open +Status: Bogus Bug Type: MySQLi related Operating System: Linux / Windows XP PHP Version: 5.2.4 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php memory_get_usage() only counts memory allocated by PHP and modules which use PHP's memory mangment routines. The libmysql allocates it's memory itself therefore PHP doesn't know about it. Previous Comments: ------------------------------------------------------------------------ [2007-10-08 15:10:01] windeler at mediafinanz dot de Description: ------------ I am using the latest stable PHP version 5.2.4 on Windows XP (SP2) and Linux (Kernel 2.6.16) and a MySQL Database version 5.0.45. In both cases mysqli_free_result doesn't seem to free the allocated memory. Reproduce code: --------------- $db = new mysqli("localhost", "username", "password", "database"); for ($i = 1; $i <= 100; $i++) { echo 'turn '.$i.'<br />'; echo "before query: ".memory_get_usage(false).'<br />'; $dbResult = $db->query("SELECT * FROM example LIMIT $i, $i"); $row = $dbResult->fetch_assoc(); echo "before close: ".memory_get_usage(false).'<br />'; $dbResult->free(); unset($dbResult); echo "after close: ".memory_get_usage(false).'<br /><br />'; } Expected result: ---------------- turn 1 before query: 75624 before close: 79736 after close: 75624 turn 2 before query: 75624 before close: 79834 after close: 75624 turn 3 before query: 75624 before close: 79976 after close: 75624 [...] turn 100 before query: 75624 before close: 79858 after close: 75624 Actual result: -------------- turn 1 before query: 75624 before close: 79736 after close: 79872 turn 2 before query: 79872 before close: 84184 after close: 84184 turn 3 before query: 84184 before close: 84200 after close: 84240 [...] turn 100 before query: 85360 before close: 85360 after close: 85360 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42891&edit=1
