[TYPO3-dev] EM problems

Dimitri Tarassenko mitka at mitka.us
Thu Apr 6 22:16:00 CEST 2006


Martin,

On 4/6/06, Martin Kutschker <Martin.Kutschker at n0spam-blackbox.net> wrote:

> But does unset($x) really help? Is PHP smart enough to do a garbage
> colection before we run out of memory?

Garbage collection is something that happens when a function return()s
and all memory allocated for call stack and local variables that
weren't explicitly unset() is freed up. So, if you unset() stuff right
before you return from a function, then no, it doesn't help. If you
unset something in the middle of a function before allocating more
memory for something else then yes, it does.

Looking at EM code I think that the real way to improve stuff is to
convert many by-value functions to by-reference and stop using
"convenient" shortcuts like implode(gzfile()) that produce a spike in
memory usage (in my standalone test, implode(gzfile()) on a 5M file
required 16M of memory to complete successfully).

Right now, memory consumption is a secondary problem. I would gladly
let EM be as it may and eat up 256M or more if it worked at all. ;)

--
Dimitri Tarassenko


More information about the TYPO3-dev mailing list