How can i solve Magento Out of memory Fatal error? - magento

Magento 1.9.x with xampp-win32-7.0.4 showing following type error randomly
Fatal error: Out of memory (allocated 14680064) (tried to allocate 790528 bytes) in lib\Less\Parser.php on line 3719
Fatal error: Out of memory (allocated 134217728) (tried to allocate 16384 bytes) in lib\Varien\Image\Adapter\Gd2.php on line 74
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 16384 bytes) in lib\Zend\Db\Statement\Pdo.php on line 228
I try as following link but nothing happen
https://indiestechtips.wordpress.com/2012/10/13/magento-fatal-error-out-of-memory-allocated-14680064-tried-to-allocate-1245184-bytes/

You could try to increase the memory limit to 512 in your Magentos root folder .htaccess. Just find the following lines and adjust the value for memory_limit:
<IfModule mod_php5.c>
############################################
## adjust memory limit
php_value memory_limit 512M
If you still run out of memory, there might be another problem in your Magento installation that consumes so much.

add this code to index.php
ini_set('memory_limit', 256M);
If the problem still comes increase the limit.

Related

Can't run a testsuite with phpunit

I am trying to do a phpunit testsuite inside my "Homestead" vagrant box.
I have like 12 tests only..
It was working fine, but suddenly I cant run it anymore.. It give me this error:
vagrant#homestead:~/code/ticketbeast$ ./vendor/bin/phpunit
PHPUnit 7.5.9 by Sebastian Bergmann and contributors.
......PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /home/vagrant/code/ticketbeast/vendor/laravel/framework/src/Illuminate/Validation/Validator.php on line 315
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 32768 bytes) in /home/vagrant/code/ticketbeast/vendor/symfony/debug/Exception/FatalErrorException.php on line 1
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /home/vagrant/code/ticketbeast/vendor/laravel/framework/src/Illuminate/Validation/Validator.php on line 315
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 32768 bytes) in /home/vagrant/code/ticketbeast/vendor/symfony/debug/Exception/FatalErrorException.php on line 1
It seems that there was a (callback function) inside some test was causing the problem for me. Everything works now.

How to fix allowed memory size exhausted in Laravel?

I am using Laravel 5.6 in windows 10. The database that I used is MySQL 8.0 . When i try to load web view from my browser, memory size exhausted error message occur in laravel log and does show anything in web view.
[Wed Dec 26 09:34:47 2018] PHP Fatal error:
Allowed memory size of 2097152 byte s exhausted (tried to allocate
4096 bytes) in D:\Project\Project-Serve\ven
dor\composer\autoload_static.php on line 168
Look up "etc/php/7.0/cli/php.ini" this directory.
In the php.ini file change this:
; Old one
; memory_limit = 2048M
; New one
; memory_limit = 4096M
Increase the memory_limit in php.ini file.
To know which php.ini is loading. use following command
php -i | grep "php.ini"
Restart web server.

elasticsearch JDBC -RIVER java.lang.OutOfMemoryError: unable to create new native thread

I am using elasticsearch "1.4.2" with river plugin on an aws instance with 8GB ram.Everything was working fine for a week but after a week the river plugin[plugin=org.xbib.elasticsearch.plugin.jdbc.river.JDBCRiverPlugin
version=1.4.0.4] stopped working also I was not able to do a ssh login to the server.After server restart ssh login worked fine ,when I checked the logs of elastic search I could find this error.
[2015-01-29 09:00:59,001][WARN ][river.jdbc.SimpleRiverFlow] no river mouth
[2015-01-29 09:00:59,001][ERROR][river.jdbc.RiverThread ] java.lang.OutOfMemoryError: unable to create new native thread
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: unable to create new native thread
After restarting the service everything works normal .But after certain interval the same thing happen.Can anyone tell what could be the reason and solution .If any other details are required please let me know.
When I checked the number of file descriptor using
sudo ls /proc/1503/fd/ | wc -l
I could see it is increasing after every time . It was 320 and it now reached 360 (keeps increasing) . and
sudo grep -E "^Max open files" /proc/1503/limits
this shows 65535
processor info
vendor_id : GenuineIntel
cpu family : 6
model : 62
model name : Intel(R) Xeon(R) CPU E5-2670 v2 # 2.50GHz
stepping : 4
microcode : 0x415
cpu MHz : 2500.096
cache size : 25600 KB
siblings : 8
cpu cores : 4
memory
MemTotal: 62916320 kB
MemFree: 57404812 kB
Buffers: 102952 kB
Cached: 3067564 kB
SwapCached: 0 kB
Active: 2472032 kB
Inactive: 2479576 kB
Active(anon): 1781216 kB
Inactive(anon): 528 kB
Active(file): 690816 kB
Inactive(file): 2479048 kB
Do the following
Run the following two commands as root:
ulimit -l unlimited
ulimit -n 64000
In /etc/elasticsearch/elasticsearch.yml make sure you uncomment or add a line that says:
bootstrap.mlockall: true
In /etc/default/elasticsearch uncomment the line (or add a line) that says MAX_LOCKED_MEMORY=unlimited and also set the ES_HEAP_SIZE line to a reasonable number. Make sure it's a high enough amount of memory that you don't starve elasticsearch, but it should not be higher than half the memory on your system generally and definitely not higher than ~30GB. I have it set to 8g on my data nodes.
In one way or another the process is obviously being starved of resources. Give your system plenty of memory and give elasticsearch a good part of that.
I think you need to analysis your server log. Maybe In: /var/log/message

Joomla website error exception.php on line 117

Please anyone suggest how to fix this issue in joomla website
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 41 bytes) in /home/content/46/8440746/html/libraries/joomla/error/exception.php on line 117
You need to increase memory limit of PHP
Create a file with the name php.ini
set the value like memory_limit = 80M same the file and put this php.ini file
into the administrator folder, Structure like:
joomla/administrator/php.ini
in the above structure the file php.ini is yours
Edit: the memory_limit you will change according to you
the above limit is just an example

After update Magento > Fatal error: Out of memory

After upgrading magento from 1.5.1 to 1.6.1 by ssh I get the next error:
Fatal error: Out of memory (allocated 41418752) (tried to allocate 24768513 bytes) in /home/username/public_html/downloader/lib/Mage/Archive/Abstract.php on line 45
I edited my php.ini to:
max_execution_time = 18000
max_input_time = 6000
memory_limit = 256M
Does anyone have an idea how to solve this problem?
After trying and searching for a whole day it's getting pretty frustrating.
Any help would be realy appreciated!
Thanks
You're editing the wrong php.ini file.
(tried to allocate 24768513 bytes)
24768513 bytes is about 24188 KB, which is about 23 MB. Your changes aren't being seen.
Temporarily add a call to
phpinfo();
exit;
to the top of whatever PHP file is your main entry point. That's index.php for a web context, mage.php for Magento Connect context.
This will tell you which php.ini file(s) PHP is using, as well as what the runtime values are for all the ini flags. Edit this file instead.
If you can't edit this file, use the ini_set function to set a value at runtime.
Can you, please, provide an information what concretly you did? (Step by step)
I think you need to change php.ini to:
memory_limit = 512M
As you see message that
(allocated 41418752) (tried to allocate 24768513 bytes)
What is the reason of updating by ssh?
Are there any other cases to update magento?

Resources