exec php

$m = memory_get_usage();
echo $m;
require_once(‘include/entryPoint.php‘);
// for ($i=0; $i < 500000; $i++){
// $rliBean[] = BeanFactory::newBean(‘ibm_RevenueLineItems‘);
// }

if ($argc == 1) {
for ($i=0; $i < 5; $i++) {
exec(‘php -d display_errors ‘ . $argv[0] . ‘ ‘ . $i , $output, $return);
echo $output;
}
} elseif (isset($argv[1])) {
for ($i=0; $i < 50000; $i++) {
$rliBean[] = BeanFactory::newBean(‘ibm_RevenueLineItems‘); // 消耗内存的代码
}

$am = memory_get_usage();
//echo PHP_EOL;
//echo $am;
echo PHP_EOL;
echo $am - $m;
}

备忘,用exec函数做对文件的递归调用,防止单次执行内存消耗过大导致内存泄漏

exec php,布布扣,bubuko.com

exec php

上一篇:C# 对JS编码/解码进行转换


下一篇:NetworkView