Will GC collect object a and b if they only have reference to each other?
问题 Will GC collect object a and b if they only have reference to each other? Can you help explain the reason or give a referece doc to explain that logic. Thanks much 回答1: Yes they will be candidate to GC if no more strong references to it exist. It's important to note that not just any strong reference will hold an object in memory. These must be references that chain from a garbage collection root . GC roots are a special class of variable that includes : Temporary variables on the stack (of