Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is it true that objects don’t always get destroyed immediately when the last reference goes away?

0
Posted

Is it true that objects don’t always get destroyed immediately when the last reference goes away?

0

Yes. The garbage collector offers no guarantees about the time when an object will be destroyed and its memory reclaimed. There was an interesting thread on the DOTNET list, started by Chris Sells, about the implications of non-deterministic destruction of objects in C#. In October 2000, Microsoft’s Brian Harry posted a lengthy analysis of the problem. Chris Sells’ response to Brian’s posting is here.

Related Questions

Thanksgiving questions

*Sadly, we had to bring back ads too. Hopefully more targeted.