Bug #8931 Updated: Memory leaks attributable to OO PHP
| From: | lobbin@php.net | Date: | Wed, 02 Jan 2002 18:52:08 +0000 |
| Subject: | Bug #8931 Updated: Memory leaks attributable to OO PHP | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-75629@lists.php.net to get a copy of this message | ||
ID: 8931
Updated by: lobbin
Reported By: Jason@hspace.net
Old Status: Feedback
Status: Closed
Bug Type: Performance problem
Operating System: Windows 2000
PHP Version: 4.0.4pl1
New Comment:
No feedback. Closing.
Previous Comments:
------------------------------------------------------------------------
[2001-12-12 18:46:19] yohgaki@php.net
Could you try 4.1.0 see if it help?
------------------------------------------------------------------------
[2001-01-26 06:56:42] Jason@hspace.net
I've identified the problem as PHP leaking memory when it sees code that it doesn't like,
eg. it leaks code when the script crashes with an error. I think that it leaks code even when it
reads through functions and there is code in them which it does not recognise (that it will give an
error, but ... because the function is not run, the script does not report an error, but memory is
leaked anyway).
------------------------------------------------------------------------
[2001-01-26 06:38:40] Jason@hspace.net
The short version scored 7680 hits over 2 min, whereas the Object Oriented version scored around
1700 hits over 2 min running 4 threads.
Both scripts do the same thing, query to database, with same result, but the OO version seems to be
5 times slower, so I am classifying this bug as a performance problem.
------------------------------------------------------------------------
[2001-01-26 06:32:37] Jason@hspace.net
I wrote two scripts to compare the difference in performance between simple script and one written
in OO with classes and required libraries. Both scripts accessed the SQL database using ADODB
connection. I used Microsoft Web Application Stress Tool, which seems to be very useful.
The "simple" version yielded better performance in less CPU usage (and no memory leaking),
whereas the OO version maxed out the CPU usage 100%, as well as slowly but surely leaking memory.
I tried using the unset() function in several places in the code, but this did not help much, as the
script was still leaking memory during the tests.
Using unset() to unset the COM object helped a lot, as PHP did not seem able to free the memory by
itself.
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=8931&edit=1