Re: PHP 4.0 Bug #5620 Updated: Memory leaks with classes and references to objects
| From: | Stanislav Malyshev | Date: | Wed, 16 Aug 2000 09:41:39 +0000 |
| Subject: | Re: PHP 4.0 Bug #5620 Updated: Memory leaks with classes and references to objects | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-29108@lists.php.net to get a copy of this message | ||
MM>> 1. Having a force_unref() function that a user can explicitly
MM>> mark his/her variable as unreferenced (ref_count = 0) in the end
MM>> of his/her script, so it can then be deallocated. It might not
MM>> be a polite manner, but it can break the circular reference.
What for? PHP has no real memory leaks (well, at least should not have) -
all memory that is reported as "leak" (in fact, all memory that is
allocated in the script run) is in fact freed at the end of the
request.
MM>> 2. Tagging the variables with the script run id, so that when
MM>> the script ends, it can sweep the memory and deletes everything
MM>> that has its run id, referenced or not. The reason
Guess what - Zend does this. See above.
--
Stanislav Malyshev stas@zend.com
+972-3-6139665 ext.106