I'm working on magento 2.1.9 with 1500 configurable products that leads to ~30k simple products. Unfortunaly our customer doesn't apply a percentage of discount over the products, but set a "new price" amout for every configuration (not simple) so we have ~1000 catalog rules linked to each configurable SKU.

when we had 300 configurable products reindexing the catalog price rules took 3 minutes, and less than 2GB of ram, now, to avoid out of memory we allocated 10GB of ram for the script, and it takes 20minutes to complete. We also had to switch reindexing on "schedule" since saving a single product rule was leading to 20minutes delays (and timeouts)

it seems ram usage is proportionally related to the number of products and rules, but that means when we'll have 5k configurable products we'll have to allocate 40GB of ram, and it seems a bit too much, just for reindexing the price rules...

can someone please tell me if there is something wrong with the reindexing process, or if this beavior is normal?

PHP Fatal error: Allowed memory size of 5293211648 bytes exhausted (tried to allocate 20480 bytes) in /***/magento/module-catalog- rule/Model/Rule.php on line 346


  • as expected, 10G is not enough anymore
    – Naraj
    Dec 29, 2017 at 13:54

1 Answer 1


This command directly adding the memory limit try to run this to do re-indexing.

php -dmemory_limit=6G bin/magento indexer:reindex

  • thanks, I've raised the limit at 10G and it completed succesfully, but the real question is if it's normal that it eat this much ram the reintexing process or if there are some memory leaks in the code...
    – Naraj
    Dec 4, 2017 at 13:19
  • The question is about reindexing, so the correct command should be: bin/magento indexer:reindex instead of bin/magento setup:di:compile
    – Niels
    Dec 4, 2017 at 13:21
  • Check this link you can get some idea stackoverflow.com/questions/39601758/… Dec 4, 2017 at 13:38
  • thanks again Jeeva, but the problem is not raising the memory limit, the problem is the excessive memory usage of the reindex process
    – Naraj
    Dec 4, 2017 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.