Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.2.3
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Hide$ ./symfony -V
symfony version 1.4.8 (/home/marcin.dryka/htdocs/leak/lib/vendor/symfony/lib)
$ php -v
PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:41:55)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
Ubuntu Server (lucid)Show$ ./symfony -V symfony version 1.4.8 (/home/marcin.dryka/htdocs/leak/lib/vendor/symfony/lib) $ php -v PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:41:55) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans Ubuntu Server (lucid)
Description
I've created new symfony 1.4.8 project:
$ ./symfony -V
symfony version 1.4.8 (/home/marcin.dryka/htdocs/leak/lib/vendor/symfony/lib)
$ php -v
PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:41:55)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
and set the database schema as follows:
$ cat config/doctrine/schema.yml
Example:
columns:
col1: string(255)
col2: string(255)
col3: string(255)
col4: string(255)
col5: string(255)
col6: string(255)
I created a task that contains a Doctrine_query call
(...)
protected function execute($arguments = array(), $options = array())
{
// initialize the database connection
$databaseManager = new sfDatabaseManager($this->configuration);
$connection = $databaseManager->getDatabase($options['connection'])->getConnection();
while(1)
{
$m = xdebug_memory_usage();
$q = Doctrine_Query::create()
->from('Example');
$o = $q->fetchOne();
if (false !== $o))
{ $o->free(true); }unset($q, $o);
printf("Delta: %s Value: %s\n",
xdebug_memory_usage()-$m,
xdebug_memory_usage()
);
}
}
(...)
Unfortunately, memory usage is increasing:
./symfony leak
Delta: 3285264 Value: 10651596
Delta: 12944 Value: 10664448
Delta: 12952 Value: 10677308
Delta: 12932 Value: 10690148
Delta: 12932 Value: 10702988
Delta: 12932 Value: 10715828
Delta: 12932 Value: 10728668
Delta: 12932 Value: 10741508
Delta: 12932 Value: 10754348
Delta: 12932 Value: 10767188
Tested with and without data in database - result is the same.
Changing hydration doesn't work for me. Same result for:
HYDRATE_ON_DEMAND
HYDRATE_RECORD
HYDRATE_ARRAY