This is the code (just a simplification of a real problem):
<?php
echo memory_get_usage() . "\n";
function f() {
throw new Exception();
}
function foo() {
try {
f();
} catch (Exception $e) {
}
}
foo();
echo memory_get_usage() . "\n";
This is the output (PHP 5.3):
630680
630848
What happened with memory (168 bytes lost)? The exception object is not destroyed? Please, help! Thanks