devman said:If you were starting fresh and it was to be a GC environment what would you call the plugin point for people to "do whatever they have to do" before an object is GCed? dealloc is hardly a good name for this.
What you are describing is commonly called "finalizing" an object. GC semantics will guarantee that the GC calls that the appropriate finalization routine before the GC deallocates the object. In Java the finalization method is finalize(). Technically in a GC-based system the programmer should not be explicitly dealloc'ing any object -- I guess this is the point of your question.
Java's finalize() method is implemented in java.lang.Object and is over-ridden by developers who need to perform finalization activity. When implementing your own finalize() method it is vital that the method does not result in the allocation of any new objects. For example no String contatenation, otherwise you can end up in some nasty race conditions.