1

Topic: [PHP, Yii] Memory leaks in the console application at sets of records in

The question following, at an insertion set of records in a DB arises memory leak.
The console application fulfills import of a database from a file in mysql.  I read out a line after line from a file, and on one record I interpose in

$databaseFileHandle = fopen ($databaseFile, "r");
try {
while (! feof ($databaseFileHandle)) {
$databaseFileLine = fgets ($databaseFileHandle);
$databaseFileLine = trim ($databaseFileLine);
if (strlen ($databaseFileLine)> 0) {
$databaseFileLineEncoded = json_decode ($databaseFileLine, true);
$this-> processPropertyDataComplete ($databaseFileLineEncoded);
}
}
} finally {
fclose ($databaseFileHandle);
}

Well and  function of handling

$propertyRoom = new PropertyRoom ();
$propertyRoom-> native_id = $room ["id"];
if (! empty ($room ["name"])) {
$propertyRoom-> name = $room ["name"];
}
if (isset ($room ["descriptions"]) && isset ($room ["descriptions"] ["overview"])) {
$propertyRoom-> description_overview = $room ["descriptions"] ["overview"];
}
$propertyRoom-> save ();

In the course of performance I need to process more than 1000000 records. All works normally, only here in process  storage consumption, and on 200000 element the script falls because of excess of consumption of storage.
Someone can  in what a problem?

PHP 7.0.29 (cli) (built: Mar 30 2018 11:03:14 AM) (NTS)
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies

2

Re: [PHP, Yii] Memory leaks in the console application at sets of records in

In most  there is any logic?

3

Re: [PHP, Yii] Memory leaks in the console application at sets of records in

Hett wrote:

In most  there is any logic?

In that and a problem that is not present.
PropertyRoom extends CActiveRecord
And there as a matter of fact except the description of the model is not present.

4

Re: [PHP, Yii] Memory leaks in the console application at sets of records in

Can and in most  leak. Not so long ago faced a leak problem in the driver (mongodb which they then recognized and corrected). As a variant, - it is possible to experiment with versions if of the code are assured (I here it is not assured, as it did not see completely).