-
Notifications
You must be signed in to change notification settings - Fork 29
Failure to allocate memory error when importing customers in admin #43
Comments
From @sopedro on April 8, 2017 17:28 Hi, same issue here in CE 2.1.5. This is weird, no log results at all, I don't know how to fix it... Thanks, Pedro |
From @IlnitskiyArtem on June 30, 2017 10:6 @kevin-carroll-cl , Thanks for the feedback. |
From @adriansavuosf on July 19, 2017 7:7 Hi, We have the same problem as described in the ticket by kevin-carroll-cl . In order to reproduce it you need to have a store that already have inside a lot of customer (our import doesn't work after 100k users and memory limitation of 256 MB). When you are trying to import new customers after a specific number of customers are already imported, you will not be able to import even 1 more customer. |
From @IlnitskiyArtem on July 24, 2017 14:22 @kevin-carroll-cl Internal ticket MAGETWO-70964, which tracks this GitHub issue, is in our issue backlog. |
From @magento-engcom-team on September 22, 2017 16:24 @kevin-carroll-cl, thank you for your report. |
From @MattDelac on October 27, 2017 9:18 Hi @sopedro Did you find any work around ? Thanks |
From @MattDelac on October 27, 2017 10:51 As a similar problem, if I import 100 customers, it works but it fails with more than 150 clients (for a total database of 2K existing clients) An there is NO information concerning the failure Does someone have any idea of how can I resolve this problem ? Thank you in advances |
So I am going to have a look at this. Have looked at a set of 10000 customers and the import is working fine with a memory limit of 268M. I will try to generate a set of 50000 customers and then see how the import behaves. |
…ustomer data in the database on low memory systems - replace the usage of the CollectionByPagesIteratorFactory with a fetchAll when loading current customers from the database, this was causing issues because of the extra overhead that the the iterator caused by using objects to store each row's data in this way we can use a similar approach to how the product import loads old skus. See: Magento\Catalog\Model\ResourceModel\Product::getProductEntitiesInfo
…t use the DataObject - replace current usage, - keep BC by using the toArray method of the DataObject in the current public method
- since we are now working with the connection in the load method we need to correct mocks in place
- uses getMockBuilder - only has items that are needed
- make sure that we are testing the new method for adding customer by array
… object is used - in the addCustomer covert $customerData['id'] to $customerData['entity_id'] so that older code that uses customer objects will still work as expected
…port/CustomerComposite.php - make sure that the data format used when importing data matches the expected format
- fix up the lines of over 120 characters - import classes that will be used to shorten lines
Merged under the PR #97 |
MAGETWO-66666: Adding a product to cart from category page with an ex…
From @kevin-carroll-cl on March 10, 2017 19:51
When importing customers into a site with a large number of existing customers through the standard Magento importer tool (System > Data Transfer > Import), with Entity Type: Customers Main File, and Import Behavior: Add/Update Complex Data, the import POST returns a 500 status caused by exceeding allowed memory limits.
Preconditions
Steps to reproduce
Expected result
Actual result
The memory use appears to be mainly triggered by framework level code (
\Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot::registerSnapshot
), and is likely platform independent.Through profiling and debugging we have found 2 very expensive processes that seem to be contributing to this. When beginning the customer import,
\Magento\CustomerImportExport\Model\ResourceModel\Import\Customer\Storage::getCustomerId
is called, which triggers\Magento\CustomerImportExport\Model\ResourceModel\Import\Customer\Storage::load
to execute which in turn executes\Magento\ImportExport\Model\ResourceModel\CollectionByPagesIterator::iterate
. Through this process every existing customer account is retrieved and loaded, which is a costly procedure to begin with, but then the email, website id and customer ids are loaded into a multidimensional array. Additionally, loading the customer array as part of the CollectByPagesIterator::iterate method, triggers snapshotting every customer and loading the whole entity data into another in memory array.Every existing customer is loaded and initialized as a full customer entity object, and data is held in multiple in-memory locations, in order to import a relatively small collection of new customers. This is an unsustainable practice, is costly in time, processing, and memory, and it is difficult to see the value in doing this.
Copied from original issue: magento/magento2#8851
The text was updated successfully, but these errors were encountered: