• Post Reply Bookmark Topic Watch Topic
  • New Topic

object elegible for gc?  RSS feed

 
sai panindra
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If an object is referred to by a reference variable which itself is inside another object in the heap, then is this object eligible for garbage collection?
The former object is not referred to by any other reference variable...
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"noname" , please change your name as we have policy here.

If an object is referred to by a reference variable which itself is inside another object in the heap


reference variable does not reside in heap. only object does. To be more clearer , an object is not eligible for GC until it is referenced by some reference variable.
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Balu, thank you for noticing the naming violation.

Should there be a "not" somewhere in your last posting?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!