note 22089 added to language.references.return
| From: | shelby_at_downloadfast_dot_com@php.net | Date: | Thu, 06 Jun 2002 07:29:03 +0000 |
| Subject: | note 22089 added to language.references.return | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31523@lists.php.net to get a copy of this message | ||
Regarding comment above posted on 13-Sep-2001 12:42, the likely reason PHP memory management
suffered was because you probably ended up with circular references, which cause memory leaks. The
leaks are cleaned up at thread close, but for complex long running thread, leaks could become too
large. This is fairly undocumented (spread out across various threads in mailing list discussions).
A circular reference is where a parent references it's child somewhere in it's hierarchy
of children, and that child references that parent, or any of it's parents or children. This is
a reference lock and there is no way the reference count will every go to 0 for the involved
hierarchy and thus memory is not freed in PHP's normal reference counting memory management. A
garbage collection scheme might solve this, but even then very difficult in complex scenarios. In
essense thread termination, a dumb "garbage collection" (all memory recovered) occurs for
that thread's memory use.
--
http://www.php.net/manual/en/language.references.return.php
http://master.php.net/manage/user-notes.php?action=edit+22089
http://master.php.net/manage/user-notes.php?action=delete+22089
http://master.php.net/manage/user-notes.php?action=reject+22089