SCJP Study Notes

Garbage Collection

  • Garbage collection can not be forced.
  • Calling System.gc() or Runtime.gc() methods makes only suggestions.
  • Garbage Collector runs in low memory situations and informs the object when it is about to be garbage collected.
  • Setting an object's reference to null makes it a candidate for garbage collection.
  • Java guaranties that the finalize method will be run before an object is garbage collected.
  • An object becomes eligible for garbage collection when it becomes unreachable.

contents | previous | next