Resolving memory leak issues when performing bulk query inserts in Laravel
This issue occurs because logs and events are executed for every query event, causing them to keep accumulating in memory.\ Running the code above prevents the
GGAMI
ini_set('memory_limit','-1');
DB::disableQueryLog();
DB::unsetEventDispatcher();This issue occurs because logs and events are executed for every query event, causing them to keep accumulating in memory.
Running the code above prevents the logs and events from being executed, so memory does not build up.