Wrox Programmer Forums
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 3rd, 2007, 01:38 AM
Registered User
Join Date: Sep 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Garbage Collection

what is the time duration in which garbage collection is calling by CLR.

Azizur Rehman
Old February 3rd, 2008, 11:16 AM
Registered User
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

First off, there's no set timer that goes off to initialize the garbage collector.

Garbage collection happens when the user's system starts running low on resources or during periods of inactivity. You should, from a programmer's stand-point, consider it to go off randomly.

You can [u]request</u> the garbage collector to run, but almost everyone I know, and every author I've ever read, suggest against doing this manually.

If you need a resource released, or and action to occur upon garbage collection, it's best to have your class implement IDisposable and then use a using block for the variable.

Similar Threads
Thread Thread Starter Forum Replies Last Post
garbage collection generalization tapan General .NET 2 April 27th, 2007 07:13 AM
Garbage collection in VC++ chandugsekhar BOOK: Beginning Visual C++ 6 0 October 18th, 2006 12:09 PM
Garbage Collection Survey S.Marion General .NET 1 June 7th, 2005 12:46 PM
Garbage Collection... kk_katepally General .NET 1 December 21st, 2004 04:18 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.