Return to Snippet

Revision: 39425
at January 17, 2011 21:55 by TheJasonParker


Initial Code
public function __construct(Zend_Db_Adapter_Abstract $adapter)
    {
        parent::__construct($adapter);
        if (!in_array(self::STRAIGHT_JOIN_ON, self::$_joinTypes)) {
            self::$_joinTypes[] = self::STRAIGHT_JOIN_ON;
            self::$_partsInit = array(self::STRAIGHT_JOIN => false) + self::$_partsInit;
        }
    }

Initial URL
http://blog.ewtechnologies.com/magento-2/magento-memory-leak-1-4-1-1/

Initial Description
This fixes the way Magento imports data as it just keeps adding ‘straight join’ to the array which uses a lot of memory if your importing a lot of products and will kill the import. 

Replace this function in /lib/Varien/Db/Select.php

This has been fixed in the next update and a discussion can be seen here...

http://www.magentocommerce.com/boards/viewthread/113901/

Initial Title
Magento Memory Leak v1.4.1.1 (The Array of Death)

Initial Tags
magento

Initial Language
PHP