Garbage collector, object dumper and an interesting situation

Posted on January 4, 2011

In the previous post [*] there was a great discussion between me and me (anonymous is also me).

I have removed a comment that had some replies. The comment object was removed from a collection (and I assume that this collection was dumped on a disk without of this object), but since it still has references, it was not GC’ed. GNU Smalltalk VM still holds it in memory and reply comments are rendered correctly (but they point to nowhere).

Ok, but what will happen if I will restart the image? :) I assume that since each comment has a reference on it’s “root” in the reply tree, the removed comment still is stored in the dumped file, however not as a member of collection but as a nested in another comment(s).

I will pass the db to hexdump in order to get more info.

[*] Currently there is no “previous post”, it was corrupted during development. My binary NoSQL persistence workaround is not very robust, well, I need to implement an SQL DB backend.