I have two situations:
- When an object (has only strong refs) loses all of its strong references, it becomes available for garbage collection.
- When the object has only weak references, it also becomes available for garbage collection.
In what situation the object will be collected faster? Or there is no difference?
I'm working on the old android application. And my predecessor used the weak reference (as instance variables) to storing views in the holder for the RecyclerView's adapter. I want to know why he did that. I had an idea that can be weak reference forced GC to collect the object. I mean that in the next garbage collection the object with only weak references to 100% will be collected when object without references maybe not. This can be so?