• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

a question about GC?

 
Peter Wei Cai
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Which of following are correct?
a, You can directly run the garbage collector whenever you want to
b, You can directly run the garbage collector whenever you want to, but you can not directly free the memory allocated by an object.
c, The garbage collector informs your object when it is about to be garbage collected.
Thank you for any suggestion!
 
Bin Zhao
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think c) is the answer.
Since you can never directly run GC, a) and b) are wrong
 
Sagar Sharma
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
c is obviously right because of the mark and sweep algorithm that the gc uses.
sagar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic