Here is my case:
I wrote a script as a consumer of Message Queue. But I found the memory usage will be increased after called Model::find().
e.g.
<?php
namespace app\extensions\command;
use app\models\Member;
class Test extends \lithium\console\Command
{
public $openid;
public function run()
{
while(true) {
Member::findById(3);
sleep(1);
var_dump(str_pad(round(memory_get_usage(true) / (1024 * 1024), 2) . "M", 7));
}
}
}
output:
libraries/lithium/console/li3 test --env=test
string(7) "4M "
string(7) "4M "
string(7) "4M "
string(7) "4M "
string(7) "4M "
string(7) "4M "
string(7) "4M "
string(7) "4M "
string(7) "4M "
string(7) "4M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.25M "
string(7) "4.5M "
string(7) "4.5M "
string(7) "4.5M "
Here is my case:
I wrote a script as a consumer of Message Queue. But I found the memory usage will be increased after called
Model::find().e.g.
output: