how does the garbage collector in java determine that objects are no longer referenced by the program?
It depends on the VM but there are a number of ways it could be done.
Check this out.
Reference :
Fig : General Collection of Object
Fig : Memory Collection of Objects

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With