4
I had been suffering from similar problems and it took me long time to figure out.
In the following case, memory consumption is tremendously high (for me it only happens with my Windows+apache+PHP) :
function_one(function_two(), $args);
where
function function_one($string, $args)
{...}
function function_two()
{
return $someString;
}
Then you have to change to:
$mystring = function_two();
function_one($mystring, $args);
I do not know what the cause is, beyond my PHP (or server config) knowledge.