Answer the question
In order to leave comments, you need to log in
How to fix memory leak of yii2 models?
Good day.
Made a console application that runs on schedule.
A conditional selection is made. The first 100 elements. The status is completed and so on. Until all tasks for the request are completed. So with each new selection of elements, the script starts to eat memory. How to fix it?
while(true){
$task = Task::find()->select(['id'])->where(['status' => 0, 'action' => 1])->orderBy(['id' => SORT_ASC])->limit(100)->all();
// если нуль записей то выход
// обновляю статус на 1
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question