Magento 2.2.2 – developing a custom module for use within a custom theme whose parent is Magento/blank
.
I have created a command ‘discountgenerator:creatediscount’. There are two searches performed within this function. One for a product filtered by category, from a group of 3 categories, and another for a rule, filtered by name. There are only 3 categories in the store, each containing only 1 product.
When I attempt to execute the command, I receive the following error message:
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /srv/data/web/vhosts/[domain]/htdocs/vendor/magento/framework/Reflection/DataObjectProcessor.php on line 122 Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.
I have attempted to run the command using the -dmemory_limit=-1
option, without success.
When I look at magento’s system.log
file, I can see the following message:
[2018-02-14 21:18:04] main.WARNING: Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size. Please update innodb_buffer_pool_size or decrease batch size value (which decreases memory usages for the temporary table). Current batch size: 1000; Allocated memory size: 3000000 bytes; InnoDB buffer pool size: 8388608 bytes. [] []
Several entries appear each time I attempt to run the command, each with different batch sizes etc.
I have attempted to resolve this issue by implementing the following code within my module’s di.xml
file:
<type name="Magento\Catalog\Model\Indexer\Category\Product\Action\Full"> <arguments> <argument name="batchRowsCount" xsi:type="array"> <item name="configurable" xsi:type="number">200</item> </argument> </arguments> </type>
No matter how much I reduce the value, I receive the same errors. I have read through the documentation but I can’t see any other relevant attributes which would cause this.