Will this be garbage collected in JVM?
- by stjowa
I am running the following code every two minutes via a Timer:
object = new Object(this);
Potentially, this is a lot of objects being created and a lot of objects being overwritten. Do the overwritten objects get garbage collected, even with a reference to itself being used in the newly created object?
I am using JDK 1.6.0_13.
Thanks for the help.