Ejemplo n.º 1
0
$fhandle = fopen($fname, "wb");
fwrite($fhandle, $content);
fclose($fhandle);
unset($content);
unset($fhandle);
//$a->__destruct();
unset($a);
gc_collect_cycles();
//exit;
$cnt = 0;
print "<br>MEMORY BEFOR:" . memory_get_usage() . "<br>\n";
while (true) {
    $cnt++;
    $fhandle = fopen($fname, "rb");
    $content = fread($fhandle, filesize($fname));
    $result = $content;
    $a = new a();
    $a->parseFromString($result);
    //	$a->__destruct();
    unset($a);
    fclose($fhandle);
    unset($fhandle);
    unset($content);
    unset($result);
    //gc_collect_cycles();
    print "<br>MEMORY ITERATION:" . $cnt . ' ' . memory_get_usage() . "<br>\n";
    if ($cnt == 10) {
        break;
    }
}
print "<br>MEMORY AFTER:" . memory_get_usage() . "<br>";