FN-FORUM: PHP Memory Problems
date posted 5th March 2003 17:41
Hello Luvverly People
I have a problem with a site that is constantly running out of memory, no
matter how many times we up the memory allocation to php. To give you a bit
of background; we are using an adodb layer, above which is a layer of data
objects, and above which is a layer of code objects. We are also using
Smarty templates. Now, the data objects all make use of a central data
object that does all the hard work (creates SQL queries on the fly etc etc),
and returns the result set in an array to the kids. The data objects need to
be shared between the code objects, so that the results from one query are
available to another code object, and so are all references within a toolbox
object, which serves them up to whichever code object happens to need one of
them at the time. Sometimes a data object (data objects are a distinct set
of data functionality, basically encompassing a set of tables and their
relationships) may need to call on another data object for some help, and
will do so via the toolbox for this purpose, just as though it (the data
object doing the calling) was a code object.
I've been worried about circular references due to this, but all the tests
we've done seem to have negated this possibility. We're now thinking that
the array of results that a data object holds may be the problem, but I'm
not too sure about php memory allocation between user sessions. Does it
share its memory between user sessions? Also, the problem, if it arises,
does not disappear the next day after a night of no use (this is not a 24-hr
site), which seems to indicate that the garbage collection routines within
php are not clearing out the object references....
...any ideas?
Mercy Buckets
Caz