cancel
Showing results for 
Search instead for 
Did you mean: 

[ERROR] exception 'OverflowException' with message 'Memory limit has been reached.'

[ERROR] exception 'OverflowException' with message 'Memory limit has been reached.'

Hi,

 

So I have a previous thread, but I thought that this warrants it's own because I missed it the first time.

 

As Magento 2.x reaches 67%, it gives the following error:

 

[ERROR] exception 'OverflowException' with message 'Memory limit has been reached.' in /home/gear/public_html/vendor/magento/framework/Image/Adapter/Gd2.php:61

 

followed by a lot more code, the full code where the error occurs as follows:

 

Module 'Magento_Theme':
Installing data.. 
[ERROR] exception 'OverflowException' with message 'Memory limit has been reached.' in /home/gear/public_html/vendor/magento/framework/Image/Adapter/Gd2.php:61
Stack trace:
#0 /home/gear/public_html/vendor/magento/framework/Image.php(55): Magento\Framework\Image\Adapter\Gd2->open('/home/gear/publ...')
#1 /home/gear/public_html/vendor/magento/framework/Image.php(36): Magento\Framework\Image->open()
#2 /home/gear/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(99): Magento\Framework\Image->__construct(Object(Magento\Framework\Image\Adapter\Gd2), '/home/gear/publ...')
#3 /home/gear/public_html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(89): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#4 /home/gear/public_html/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...', Array)
#5 /home/gear/public_html/vendor/magento/framework/Image/Factory.php(45): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array)
#6 /home/gear/public_html/vendor/magento/framework/View/Design/Theme/Image.php(126): Magento\Framework\Image\Factory->create('/home/gear/publ...')
#7 /home/gear/public_html/vendor/magento/module-theme/Model/Theme/Registration.php(132): Magento\Framework\View\Design\Theme\Image->createPreviewImage('/home/gear/publ...')
#8 /home/gear/public_html/vendor/magento/module-theme/Model/Theme/Registration.php(111): Magento\Theme\Model\Theme\Registration->_savePreviewImage(Object(Magento\Theme\Model\Theme\Data))
#9 /home/gear/public_html/vendor/magento/module-theme/Model/Theme/Registration.php(72): Magento\Theme\Model\Theme\Registration->_registerThemeRecursively(Object(Magento\Theme\Model\Theme\Data))
#10 /home/gear/public_html/vendor/magento/module-theme/Observer/ThemeRegistrationObserver.php(47): Magento\Theme\Model\Theme\Registration->register(NULL)
#11 /home/gear/public_html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(73): Magento\Theme\Observer\ThemeRegistrationObserver->execute(Object(Magento\Framework\Event\Observer))
#12 /home/gear/public_html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(61): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Magento\Theme\Observer\ThemeRegistrationObserver), Object(Magento\Framework\Event\Observer))
#13 /home/gear/public_html/vendor/magento/framework/Event/Manager.php(66): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer))
#14 /home/gear/public_html/var/generation/Magento/Framework/Event/Manager/Proxy.php(95): Magento\Framework\Event\Manager->dispatch('theme_registrat...', Array)
#15 /home/gear/public_html/vendor/magento/module-theme/Setup/InstallData.php(54): Magento\Framework\Event\Manager\Proxy->dispatch('theme_registrat...')
#16 /home/gear/public_html/setup/src/Magento/Setup/Model/Installer.php(798): Magento\Theme\Setup\InstallData->install(Object(Magento\Setup\Module\DataSetup), Object(Magento\Setup\Model\ModuleContext))
#17 /home/gear/public_html/setup/src/Magento/Setup/Model/Installer.php(746): Magento\Setup\Model\Installer->handleDBSchemaData(Object(Magento\Setup\Module\DataSetup), 'data')
#18 [internal function]: Magento\Setup\Model\Installer->installDataFixtures()
#19 /home/gear/public_html/setup/src/Magento/Setup/Model/Installer.php(331): call_user_func_array(Array, Array)
#20 /home/gear/public_html/setup/src/Magento/Setup/Controller/Install.php(97): Magento\Setup\Model\Installer->install(Array)
#21 /home/gear/public_html/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(82): Magento\Setup\Controller\Install->startAction()
#22 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#23 /home/gear/public_html/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#24 /home/gear/public_html/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#25 /home/gear/public_html/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#26 /home/gear/public_html/vendor/zendframework/zend-mvc/src/DispatchListener.php(93): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#27 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#28 /home/gear/public_html/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#29 /home/gear/public_html/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#30 /home/gear/public_html/vendor/zendframework/zend-mvc/src/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent),

I know in 1.x there was a problem with the memory limit only interpreting M and KB but not G. This version of Gd2.php has the if/then/else to fix that. But the error still occurs here. 

 

Can anyone help me fix this?

3 REPLIES 3

Re: [ERROR] exception 'OverflowException' with message 'Memory limit has been reached.'

What is the memory_limit value of your PHP interpreter?

Re: [ERROR] exception 'OverflowException' with message 'Memory limit has been reached.'

In PHP.ini, it is as follows:

 

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 18000
max_input_time = 60
max_input_vars = 1000
memory_limit = 1024M

Re: [ERROR] exception 'OverflowException' with message 'Memory limit has been reached.'

PHP can have different settings for CLI and webserver.

Please execute the following command from the bin/magento folder:

php -i | grep memory_limit