Garbage collection won't dump anything having references to it. On the other
hand, GC is capable of correctly handling circular references, so if there
are two objects referencing each other, but there are no other references to
these objects, the objects will be dumped. So yes, it is absolutely safe to
use linked lists - just make sure to clear all references to a node being
removed from the list for it to be collectible for the GC.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.