ID: 28424 User updated by: technik at perlentaucher dot de Reported By: technik at perlentaucher dot de -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: Linux PHP Version: 5CVS-2004-05-17 (dev) New Comment:
MIGHT BE A MYSQL CONFIG ISSUE ?!?!? While testing i discovered that it seems to stop at end of memory without using swap. could be a cache-feature ??? I changed status of this Bug to Bogus until I'm sure that's really a Bug. greetings, Adam Previous Comments: ------------------------------------------------------------------------ [2004-05-17 21:45:25] technik at perlentaucher dot de Description: ------------ Hi all, mysql_result seems to leak memory as I Commented in Bug #27758. I thought it's worth a new Bugreport. I tried to find out more about it, so i wrote a Script that reads in Data from my DB and calculates Memory usage in a loop. The Table looks like that : 28000 identical Records ID : int11, auto_increment DATA : varchar(20) = 'ABCDEFGHIJKLMNOPQRTS' The Script reads all Records 300 Times before calculating memory usage. The Result looks like that : (mem in kb) Index Used Free Dif Start 176512 1326208 0 loop 1 176704 1326016 192 loop 2 176776 1325944 72 loop 3 176816 1325904 40 loop 4 176876 1325844 60 loop 5 177028 1325692 152 loop 6 177164 1325556 136 loop 7 177316 1325404 152 loop 8 177492 1325228 176 loop 9 177716 1325004 224 Absolute dif 1204 So usage of Memory is not same in every Loop !! But at the end I miss about 1.2M of my Memory. I also could not free this memory by killing httpd (killing mysqld also didn't help) I'm using gentoo, kernel is 2.4.20-gentoo-r7. Apache : 2.0.48 PHP5 : php5-200405131230 (cvs snap) Greetings, Adam Cwientzek Reproduce code: --------------- for ( $x=0; $x<300; $x++ ) { $db = mysql_connect("localhost", "root", "test"); mysql_select_db("test"); $sql = "select data from test"; $result = mysql_query($sql); // causes MEM-Leak !!!! mysql_free_result($result); mysql_close($db); } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28424&edit=1