#49711 [Opn->Fbk]: Memory Leak in Deprecated Methods
| From: | jani@php.net | Date: | Tue, 29 Sep 2009 15:14:32 +0000 |
| Subject: | #49711 [Opn->Fbk]: Memory Leak in Deprecated Methods | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-143042@lists.php.net to get a copy of this message | ||
ID: 49711
Updated by: jani@php.net
Reported By: kristina at 10gen dot com
-Status: Open
+Status: Feedback
-Bug Type: Unknown/Other Function
+Bug Type: Scripting Engine problem
Operating System: Windows
PHP Version: 5.3.0
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2009-09-29 14:49:57] kristina at 10gen dot com
Description:
------------
A method with the ZEND_ACC_DEPRECATED flag will cause memory usage to
increase each time it's called through PHPUnit. (It doesn't occur with
a PHP program run with "php script.php", so it might have something to
do with reflection.)
It occurs in 5.2.* and 5.3.*, only on Windows.
I've written a small PHP extension that demonstrates this bug. It is
available at http://github.com/beaddy1238/PHP-Memleak.
Reproduce code:
---------------
Compile the extension by putting the config.w32, php_mongo.h, and
mongo.c files in a pecl\mongo dir.
From the pecl\mongo directory, run:
phpunit tests\MongoRunner.php
It print out the memory used at the beginning and end of the function.
The function calls Mongo->lastError() (an empty method) 10000 times.
Expected result:
----------------
I expect the memory usage to stay the same.
Actual result:
--------------
The more times Mongo->lastError is called, the more memory is used.
This stops happening if ZEND_ACC_DEPRECATED is removed from mongo.c.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49711&edit=1