Hi all,
I'm having some pain with this process. I'll try to explain it well, my
english is little bad... :-)
I've got two main loops, handled by timeouts. One loop calls to an
object method every half second to do a computation. It reads from
external device, creates helper arrays for calculations, and then
creates/updates another array where the final calculations are stored.
In the other loop, fired by events or some circunstances, I loop thru
the calculations array and get the new state for some values. This is
not done on the same object.
I'm having some memory leak trouble while doing that from within objects
using global variables to store the associative arraya, so it seems to
me that some references are keep by php to these data I do generate and
destroy or update on each computation loop, and that memory it is not
freed anytime until program execution ends.
If I do the same computation, but I don't do the data lookups to the
associative arrays, the memory is normaly fred as expected -I noticed
the same trouble with this that depends on how the arrays are handled or
accesed before deleting them, when trying to test for that problem-. But
if I do the array lookups (i mean with this to do a loop to the array to
get all item updates ...) to data is being processed / updated from
other objects, the trouble I explained begin...
It is somewhat complex to give an example to reproduce the whole
thing... Notice I use php4.4.1, and sadly, it is a long running script
as it handles some phpgtk interface.
I noticed the same results when converting these global variables to
local object properties, sadly. It is possible on PHP4 to call on
runtime to the garbage collector? possibly via a php extension / C code?
Does the php garbage collector keep track of uncollectable objects /
zvals as python gc does?
It is some way to freed some memory I know it should be really
unreferenced? Some thing like a manual force to the garbage collection
of a zval -associative array at php level-?
Perhaps should I use a different mechanism for storing the associative
arrays so I could not suffer this issue?
If my trouble is not very clear, please don't hesitate to ask me.
Thanks in advance.
Regards,
Gonzalo.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php