PHP keeps throwing out-of-memory errors on me. By default PHP only
allows a script 8 megs of memory. I want to know why my script has
gotten so out-of-control when it comes to memory use. I'm assuming
there must be some array somewhere that is bloating up with
information, perhaps information that I assumed was being detroyed. It
could be a rather small mistake, causing a big problem. But how does
one debug memory allocation in PHP? There is no way, that I'm aware
of, to see the memory usage of all variables at all times.
Even if I had the patience to hit every variable in all my code with
var_dump(), just to get a rough estimate of their sizes, that still
wouldn't help, because the moment the var goes over 8 megs, it
crashes, before var_dump would have the time to print the info to me.