Skip to content

Instantly share code, notes, and snippets.

@kogir
Created May 8, 2012 17:59
Show Gist options
  • Save kogir/2638011 to your computer and use it in GitHub Desktop.
Save kogir/2638011 to your computer and use it in GitHub Desktop.
Sam on Garbage Collection

GARBAGE COLLECTING

##1. REFERENCE COUNTING * Keep a count of the number of pointers to each object, incrementing/decrementing it as variable come in/go out of scope.

##2. CYCLE DETECTION * Use any one of various methods in the literature to detect cyclical references.

##3. FREEING UNUSED MEMORY * Periodically, go through the memory use table and free all objects with reference count 0.

THE END

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment