increasing memory consumption with resources

From: Date: Tue, 22 Sep 2009 23:37:35 +0000
Subject: increasing memory consumption with resources
Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-6648@lists.php.net to get a copy of this message
Hi! Unfortunately the author of the php_sam extension seems very busy at the moment. I tried to dig into the memory leaks, but was not able to catch them completely. So I rewrote the part I need (accessing Websphere MQ) from scratch. To verify I did not include any memory leaks, I did various tests, e.g. looping over and over again. What I noticed: As soon as I started to give resources back to the userspace, the memory consumption in a "create and delete resource"-loop increased. I thought this was specific to my implementation, but a script as simple as <?php while ( true ) { $rc = fopen( "somefile.txt", "r" ); fclose( $rc ); } ?> seems to reproduce the behaviour and seems to eat memory. Of course, this is dumb, but I wonder where the memory consumption comes from. I tried this on a Windows XP machine with a 5.3 VC9 DEBUG build. To my mind, reassigning the resource zval* should free the memory used by that resource. Any hints where the memory goes? Is the garbage-collector late? greetings, Nico

« previous php.pecl.dev (#6648) next »