Wednesday, August 31, 2005

Garbage Collection

I’m working some more on my object oriented bytecode compiler + language this week, and I have automatic garbage collection (mark + sweep). (100000 objects GC’d in 0 seconds)…

First attempt maked every object as recoverable, then scanned every object (that every object pointed to) and marked off ones that each other pointed at marking them non-recoverable.. Then ran through the list again and recovered the ones marked....

It works fine, and is good for a “manual” garbage collect…

Second attempt put a “bucket” in each object that pointed back to those that referenced it. If the bucket is empty, its recoverable. Each time an object is de-referenced, the object is marked for GC if its empty…

Obviously I need to switch from using a double linked list to using an automatically balanced tree to store my list of objects…

meh…

Posted by Stu on 08/31 at 06:23 PM Permalink to this post.
Filed Under : Development
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Page 1 of 1 pages