I got this issue when creating the customer in magneto 2.
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /vendor/magento/framework/Model/ResourceModel/Db/VersionControl/Snapshot.php on line 47
due to this reason, I increased the memory limit up to 8 GB. but the issue remains.
/**
* Register snapshot of entity data, for tracking changes
*
* @param \Magento\Framework\DataObject $entity
* @return void
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
*/
public function registerSnapshot(\Magento\Framework\DataObject $entity)
{
$metaData = $this->metadata->getFields($entity);
$filteredData = array_intersect_key($entity->getData(), $metaData);
$data = array_merge($metaData, $filteredData);
$this->snapshotData[get_class($entity)][$entity->getId()] = $data;
}
issue raised in this line $data = array_merge($metaData, $filteredData);
vendor/magento/framework/Model/ResourceModel/Db/VersionControl/Snapshot.php
how to resolve this issue
Try this Allowed memory size of 792723456 bytes exhausted (tried to allocate 184320 bytes) https://magento.stackexchange.com/a/209993/49715
@Kashif answer help me a lot.
But none of the options not worked for me.
Problem solved.
My server is nginx. It memory limit defined in /etc/nginx/magento.conf
open the file and search
fastcgi_param PHP_VALUE "memory_limit=
inside the below block
location ~ (index|get|static|report|404|503|info|cleanopcache)\.php$ {
}
after found that line, the memory limit has to set as 6144M
fastcgi_param PHP_VALUE "memory_limit=6144M \n max_execution_time=600";
after that, it works fine.
you able to find how much memory limit set in your Magento projects via debug log.
make log with ini_get('memory_limit');
hope this helps you all.
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento setup:di:compile
php bin/magento cache:flush
php bin/magento cache:clean
//To run command forcefully
php -f bin/magento
//To run command with memory limit 4G
php -d memory_limit=4G bin/magento
//To run command with max memory limit
php -d memory_limit=-1 bin/magento
ini_set('memory_limit',256);
OR
ini_set('memory_limit','-1');
follow full link here https://magento.stackexchange.com/questions/209976/magento-2-2-2-allowed-memory-size-of-792723456-bytes-exhausted-tried-to-alloc/209993#209993
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.