This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • 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
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic