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:
$productis a configurable product with no image. (placeholder/fallback image is available)
$producthas no simple products associated.
$this->helper...->resize(135)is assigned to a variable (no problem when simply
echoed 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?
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.