1

Recently i noticed bunch of these error in my laravel.log

[2017-04-18 14:23:27] local.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 6284096 bytes) in /var/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:335
Stack trace:
#0 {main}

I thought its the DB::enableQueryLog(); which i used here and there, but even after removing those querylogs i still get the problem.

Is there a way to debug which query (if its a query) or a file (controller/command/job) is causing this ?

Thanks in advance.

user3570930
  • 51
  • 1
  • 6
  • it is not laravel http://stackoverflow.com/questions/561066/fatal-error-allowed-memory-size-of-134217728-bytes-exhausted-codeigniter-xml – Anar Bayramov Apr 19 '17 at 02:20
  • 1
    I had this issue once when working with intervention/imagecache and the cache set to database, not file. Either you work with BIG table values or you have to rewrite searches on tables with thousands of rows. Did you setup you table indexes correctly? https://github.com/barryvdh/laravel-debugbar could help you out to find out where the bottleneck is. – Dimitri Mostrey Apr 19 '17 at 04:03
  • @DimitriMostrey Agree. The thing is: 1. Problem is not i cant see the error live. I see the error in the log files. and its most likely from a console command. 2. the console command launches multiple times per minute (with specific params (for loop)). 3. at the specific time when the bug occurs nothing runs in the system except consumers for queue which were previously launched from the commands 4. those consumers only has bits of information (statistics inserts) and yet somewhere there is a leak. Thanks for the assistance so far. I'll try to dig more and probably update. – user3570930 Apr 19 '17 at 22:26
  • @Rodrane: This app has been live for approx 3+ months, same PHP installation, same MySQL installation ... nothing has been upgraded/changed or so ... And suddenly errors started poping out. Only thing that happened before this thing happened is I got my server forcefully shutdown (power outage). PHP version is: PHP 7.0.15, I remember I installed it the day it came live somewhere in January. Lets keep digging .... – user3570930 Apr 19 '17 at 22:33
  • Could it be that the console commands are overlapping? Ergo, one command is started while the previous, similar command, is still running. Try to log on a minute to minute base the outcome of the currently running processes on the server: `shell_exec('ps xf');` as a temporarily debug solution. When the error appears, you will most probably find the reason in the 'ps' log file. – Dimitri Mostrey Apr 20 '17 at 06:32
  • there is no overlapping ... since the nature of the processing is very delicate, i do extensive checks if same command with same exact params is running (even on every loop inside the command). so pretty sure its not that. Also... its day #2 without issues now and havent changed anything crucial. Probably laravel saw me posting the question on SO :) – user3570930 Apr 21 '17 at 00:44

0 Answers0