PHP/DOMDocument: unset() does not release resources
===

I've got a variable `$dom` that contains an instance of PHP's DOMDocument. This variable is being set and unset within a loop.

`unset($dom)` will not release memory, though: `memory_get_usage(false)` reports that only 700B of about 10MB got released. `memory_get_usage(true)` reports the exact same amount of memory usage before and after `unset()`.

I tried the following:

- I checked that the reference count of $dom is exactly one immediately before the call to `unset()`: `xdebug_debug_zval('dom')` reports: dom: (refcount=1, is_ref=0)=class DOMDocument {  }.

- I tried the solution proposed in http://stackoverflow.com/questions/8379829/domdocument-php-memory-leak but this was to no avail.

- I tried `gc_enable()` + `gc_collect_cycles()`. But this did not help either.

- I tried calling `$dom->__destruct()` before `unset()` but this will result in an error as DOMDocument apparently does not have a destructor.

- I recursively removed all nodes in the DOM before I unset the variable. It did not make the least difference.

Now I'm out of ideas... Anybody got a suggestion what else I could try to debug or solve this problem?

Edit: php -v reports 5.3.10-1ubuntu3.2 with Suhosin-Patch (cli)