Diskuze na Lopuchu,pohlazení na duchuLopuch.cz
I saw this mentioned somewhere else but if you do $var = NULL then I've noticed less memory usuage than with unset(). In fact, unset didn't do anything. This might be useful if you're doing a php-gtk app, thats starting to consume significant memory over a long period of time. This was the code I used to test // Check memory before here for($i = 0; $i < 100; $i++) { $dialog = &new GtkDialog(); $dialog->realize(); $dialog->destroy(); $dialog = NULL; //unset($dialog); } // Check memory after here Doing a difference between after and before results in: Using destroy() and unset() -> ~31kb Using $dialog = NULL -> ~13 kb The expected memory usuage should be 0kb or around there.