Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GC

 
sean cee
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
are following statements about garbage collection true?
a) GC informs your object when it is about to be garbage collected.
b) GC runs in low-memory situations.
Not sure about a)
I thought b) is false .. cos GC is vendor dependent.
Any idea?
Thanks in advance..
 
Vaneet Bhutani
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that a) is false, too. Logically, it does not seem to make cany sense to inform the object that is to be garbage collected that you are gonna' be gc'd.
Could the ranch-experts nod yes/no!
 
lakshmi nair
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a is true. And that is why finalize() is run before an object is garbage collected.
And i think b is false, since you cannot guarantee that gc will run, even at low memory situations.
Lakshmi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic