This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

GC  RSS feed

 
duhit Choudhary
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can an isolated island of objects will become eligible for the Garbage Collection???
 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
duhit Choudhary wrote:how can an isolated island of objects will become eligible for the Garbage Collection???


Well, at a very high level, the GC starts at the roots -- which include static variables of loaded classes, local variables of all threads (that is still in scope), and some JVM caches too. It then traverses all the objects -- how is traverses is different depending of which GC is running.... regardless, at the end, whatever hasn't been traversed, is considered unreachable, and eligible for GC.

Henry
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!