|
- Garbage collection does not guarantee that a program will not run out of memory. As garbage collection is JVM dependent then it is possible for programs to use memory resources faster than they are garbage collected.
-
Moreover garbage method will be run before an object is Garbage collected, it is called by the garbage collector on an object when garbage collection determines that there no more references to the object.
-
The garbage collection is controlled, it means you cannot predict when it will happen, you thus cannot predict exactly when the finalize method will run.
Once a variable is no longer referenced by anything it is available for garbage collection.
|