further I realized that an object, when getting detroyed, does care about destroying variable in object space visibility but not those in local visibility, be aware of the found pattern:
<?php
class release_test{
private $buffer;
private $other_object;
public function __construct(){
$this->other_object=new other_object_class();
}
public function __destruct(){
unset($this->other_object);
}
public allocate_mem_A(){
$this->buffer=file("/tmp/bigfile");
}
public allocate_mem_B(){
$buffer=file("/tmp/bigfile");
}
public allocate_mem_C(){
$buffer=file("/tmp/bigfile");
unset($buffer);
}
public allocate_mem_D(){
$this->other_buffer=file("/tmp/bigfile");
}
}
$A=new release_test();
$A->allocate_mem_A();
$A->__destruct();
unset($A);
$B=new release_test();
$B->allocate_mem_B();
$B->__destruct();
unset($B);
$C=new release_test();
$C->allocate_mem_C();
$C->__destruct();
unset($C);
$D=new release_test();
$D->allocate_mem_D();
$D->__destruct();
unset($D);
?>