1
votes

I am running a script on my magento store. Its suppose to create an XML file with my products but when I hit this php file, I get the following error.

Fatal error: Out of memory (allocated 55574528) (tried to allocate 32 bytes) in /home/sparklin/public_html/lib/Zend/Db/Statement/Pdo.php on line 290

I am thinking I should increase memory allocation on my server. But I don't know how to that. any help?

3
What version of Magento, there is a memory leak in older versions.B00MER

3 Answers

6
votes

I experienced a similar problem on Magento 1.7.0.2.

No matter how high I set my PHP memory_limit, I would continue to get:

PHP Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate xxx bytes) in xxx.php

In my case the problem was not anything to do with memory.

A custom model I'd developed was at fault:

    class Package_Module_Model_Modelname extends Mage_Core_Model_Abstract {

        public function _construct() {
            parent::__construct();
            $this->_init('module/model');
        }
    ...
    }

By changing the parent::__construct() to simply parent::_construct() (single underscore) solved the problem!

Calling the native constructor of Mage_Core_Model_Abstract was the problem.

1
votes

Try increasing memory in php.ini and restart apache and see if that works.

memory_limit = 16M to your php.ini file (recommended, if you have access)

or refer here:

Or you can find more details here...

Cheers

0
votes

When I made sure the cronjob was able to run -> the error disappears. Greets