Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Garbage collection program really confusing me?

 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



How come 1 object is eligible for garbage collection?
}
}
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a mock question? Then please QuoteYourSources
 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya from scjp 6 book kathy sierras but i cudnt understand how come only one object becomes eligible for garbagre collection
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vishal,

Best way to see is by drawing the objects in the question with their relationships. And a simple search will give you same exact question discussed before in the forum like this
Make a special note about the static reference too.


 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok Vijitha thanks in advance, can you give me a diagramatic representation on how to represent a garbage collection .I saw in the book related to isolations of island i was unable to understand the diagram (i did understood the diagram a bit but not in a crystal clear manner .)
 
Campbell Ritchie
Sheriff
Pie
Posts: 48972
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Draw object "A" then an arrow to object "B", etc etc.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic