Below code shows that finanlizer method being called when JVM gets short of memory. So if you increase the sleep time at Line34, then you can get - java.lang.OutOfMemoryError: Java heap space
Otherwise you will see the objects getting GCed.
Otherwise you will see the objects getting GCed.
As an output of above code you will get -
Thread98 is active with CustomObject98
Thread99 is active with CustomObject99
73 collected....
Thread98 is active with CustomObject98
Thread99 is active with CustomObject99
73 collected....