How to fix allowed memory size exhausted in Laravel? - 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.

Related

Starting Redis on Windows failing

I'm trying to start Redis on Windows 10. When I run redis-server.exe I get the following message though:
C:\Program Files\Redis>redis-server.exe
[4680] 01 Jun 19:57:30.844 #
The Windows version of Redis allocates a memory mapped heap for sharing with
the forked process used for persistence operations. In order to share this
memory, Windows allocates from the system paging file a portion equal to the
size of the Redis heap. At this time there is insufficient contiguous free
space available in the system paging file for this operation (Windows error
0x5AF). To work around this you may either increase the size of the system
paging file, or decrease the size of the Redis heap with the --maxheap flag.
Sometimes a reboot will defragment the system paging file sufficiently for
this operation to complete successfully.
Please see the documentation included with the binary distributions for more
details on the --maxheap flag.
Redis can not continue. Exiting.
I've tried adding a --maxheap value, but this causes the application to crash and print out a crash dump:
C:\Program Files\Redis>redis-server.exe --maxheap 150
[6728] 01 Jun 19:57:41.063 #
=== REDIS BUG REPORT START: Cut & paste starting from here ===
[6728] 01 Jun 19:57:41.063 # Redis version: 2.8.2400
[6728] 01 Jun 19:57:41.063 # Out Of Memory allocating 16 bytes.
[6728] 01 Jun 19:57:41.094 # --- ABORT
[6728] 01 Jun 19:57:41.094 # --- STACK TRACE
redis-server.exe!LogStackTrace(c:\release\redis\src\win32_interop\win32_stacktrace.cpp:95)(0x00000016, 0x00001C1D, 0x00000000, 0x00000001)
redis-server.exe!AbortHandler(c:\release\redis\src\win32_interop\win32_stacktrace.cpp:207)(0x00000001, 0xA222916F, 0x00000000, 0xDA31C9A7)
redis-server.exe!raise(f:\dd\vctools\crt\crtw32\misc\winsig.c:587)(0x00000001, 0x00000000, 0x00000010, 0x00000018)
redis-server.exe!abort(f:\dd\vctools\crt\crtw32\misc\abort.c:82)(0xFFE97BC0, 0x40141940, 0x00000010, 0x00000000)
redis-server.exe!redisOutOfMemoryHandler(c:\release\redis\src\redis.c:3404)(0x00000000, 0x4013FC28, 0x00001C1D, 0x0014FB80)
redis-server.exe!createSharedObjects(c:\release\redis\src\redis.c:1326)(0x4013BD44, 0x00000000, 0x00000001, 0x00000001)
redis-server.exe!initServer(c:\release\redis\src\redis.c:1733)(0x4013BD44, 0x4013BD44, 0x00000000, 0x4013BD44)
redis-server.exe!redis_main(c:\release\redis\src\redis.c:3504)(0x00490470, 0x00000000, 0x574F3E35, 0x00000000)
redis-server.exe!main(c:\release\redis\src\win32_interop\win32_qfork.cpp:1338)(0x00000000, 0x00000000, 0x00000000, 0x0034F000)
redis-server.exe!__tmainCRTStartup(f:\dd\vctools\crt\crtw32\startup\crt0.c:255)(0x00000000, 0x400344CC, 0x00000000, 0x00000000)
KERNEL32.DLL!BaseThreadInitThunk(f:\dd\vctools\crt\crtw32\startup\crt0.c:255)(0xD9E580E0, 0x00000000, 0x00000000, 0x00000000)
ntdll.dll!RtlUserThreadStart(f:\dd\vctools\crt\crtw32\startup\crt0.c:255)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
ntdll.dll!RtlUserThreadStart(f:\dd\vctools\crt\crtw32\startup\crt0.c:255)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
[6728] 01 Jun 19:57:41.172 #
=== REDIS BUG REPORT END. Make sure to include from START to END. ===
Please report this bug by following the instructions at:
http://github.com/MSOpenTech/redis/wiki/Submitting-an-Issue
Suspect RAM error? Use redis-server --test-memory to verify it.
I've tried running with the rest memory option suggested at the end of the crash dump, but this just gives me the same error as running the executable did without it:
C:\Program Files\Redis>redis-server.exe --test-memory
[756] 01 Jun 19:58:34.376 #
The Windows version of Redis allocates a memory mapped heap for sharing with
the forked process used for persistence operations. In order to share this
memory, Windows allocates from the system paging file a portion equal to the
size of the Redis heap. At this time there is insufficient contiguous free
space available in the system paging file for this operation (Windows error
0x5AF). To work around this you may either increase the size of the system
paging file, or decrease the size of the Redis heap with the --maxheap flag.
Sometimes a reboot will defragment the system paging file sufficiently for
this operation to complete successfully.
Please see the documentation included with the binary distributions for more
details on the --maxheap flag.
Redis can not continue. Exiting.
I have 14Gb of memory, so I'm finding it hard to believe it's a memory issue.
Found the answer after a wee bit of Google-ing: https://gist.github.com/anthavio/38d0ba4c916ab1911a47
Instead of using the --maxheap option (which seems to do nothing), add the value to the config:
maxheap 1000000000

How can i solve Magento Out of memory Fatal error?

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.

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