By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,779 Members | 1,498 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,779 IT Pros & Developers. It's quick & easy.

GC time

P: n/a
Hi

When exactly the GC starts collecting garbage?? (other than invoking the
Dispose method)

--
VBA
Jan 24 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

Calling Dispose does not invoke the GC. The GC is invoked when an a
reference type is created with the new operator and there is not a
contiguous chunk of memory big enough for that object. GC.Collect will
invoke the GC as well. See the following article for more details.

http://msdn.microsoft.com/msdnmag/issues/1100/gci/

Brian
On Jan 24, 4:11 pm, VBA <V...@discussions.microsoft.comwrote:
Hi

When exactly the GC starts collecting garbage?? (other than invoking the
Dispose method)

--
VBA
Jan 24 '07 #2

P: n/a
Hello VBA,

1) When u call Collect method
2) When the threshold of GC is overcome

There is a 3rd case when GC starts working but can't remember

VWhen exactly the GC starts collecting garbage?? (other than invoking
Vthe Dispose method)

---
WBR,
Michael Nemtsev [C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
Jan 25 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.