I'm having a strange problem where the following single operation causes an out-of-memory problem (limit at 512MB) when the following conditions are met:
$product
is a configurable product with no image. (placeholder/fallback image is available)$product
has no simple products associated.$this->helper...->resize(135)
is assigned to a variable (no problem when simplyecho
ed in HTML).
Following is the code:
$variable = $this->helper('catalog/image')->init($product, 'small_image')->resize(135)
I tried casting it as a string
and that relieves the problem and memory usage is not abnormal. Below...
$variable = (string)$this->helper('catalog/image')->init($product, 'small_image')->resize(135)
Any idea what's happening?
Additional info:
nginx error.log shows PHP message: PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 501481472 bytes)...
(*!*this seems very abnormal to me. It's trying to allocate ~500MB on just that one call?)
Placeholder image is available.
error.log
shows onlyPHP message: PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 501481472 bytes)...
. Where can I find a more detailed log?System > Configuration > Catalog
string
, it returns the placeholder image.