Click here to Skip to main content
15,888,521 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Garbage Collector query Pin
Tom Deketelaere11-Mar-09 0:16
professionalTom Deketelaere11-Mar-09 0:16 
GeneralRe: Garbage Collector query Pin
jugs010111-Mar-09 2:09
jugs010111-Mar-09 2:09 
GeneralRe: Garbage Collector query Pin
Tom Deketelaere11-Mar-09 2:22
professionalTom Deketelaere11-Mar-09 2:22 
GeneralRe: Garbage Collector query Pin
Gideon Engelberth11-Mar-09 3:17
Gideon Engelberth11-Mar-09 3:17 
AnswerRe: Garbage Collector query Pin
Luc Pattyn11-Mar-09 2:42
sitebuilderLuc Pattyn11-Mar-09 2:42 
GeneralRe: Garbage Collector query Pin
jugs010111-Mar-09 4:12
jugs010111-Mar-09 4:12 
GeneralRe: Garbage Collector query Pin
Dave Kreskowiak11-Mar-09 4:27
mveDave Kreskowiak11-Mar-09 4:27 
GeneralRe: Garbage Collector query Pin
Luc Pattyn11-Mar-09 4:57
sitebuilderLuc Pattyn11-Mar-09 4:57 
Hi,


jugs0101 wrote:
Does GC.Collect() force the GC to tidy up?


Yes it causes the GC to run, meaning:
1. all your threads get blocked
2. all your objects get sorted into alive, dead-to-be-finalized, and dead-to-be-collected categories; this is rather expensive
3. all your threads get unblocked
4. the collector thread gets launched (not sure it is separate, I guess it is)
5. the finalizer thread gets launched

So GC.Collect() is expensive, you shouldn't call it all the time. Also calling it explicitly disturbes the built-in statistical algorithms, so it may result in much worse behavior (that is from what I've read about it, I tend to organize and clean up may code so I never even want to call GC.Collect; but then I also avoid third-party code!).

Even when calling GC.Collect(), that does not solve some of the issues, e.g. those I mentioned in my earlier message.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


QuestionEntry into three tables having foriegn key constraints Pin
Saleem Tahiri10-Mar-09 23:14
Saleem Tahiri10-Mar-09 23:14 
AnswerRe: Entry into three tables having foriegn key constraints Pin
Tom Deketelaere10-Mar-09 23:23
professionalTom Deketelaere10-Mar-09 23:23 
QuestionIncluding player in vb.net2005 Pin
hrishiS10-Mar-09 23:04
hrishiS10-Mar-09 23:04 
AnswerRe: Including player in vb.net2005 Pin
Tom Deketelaere10-Mar-09 23:09
professionalTom Deketelaere10-Mar-09 23:09 
QuestionGetting file type info Pin
Alan Burkhart10-Mar-09 22:48
Alan Burkhart10-Mar-09 22:48 
AnswerRe: Getting file type info Pin
Xmen Real 11-Mar-09 0:13
professional Xmen Real 11-Mar-09 0:13 
GeneralRe: Getting file type info Pin
Alan Burkhart11-Mar-09 3:13
Alan Burkhart11-Mar-09 3:13 
GeneralRe: Getting file type info Pin
Xmen Real 11-Mar-09 4:02
professional Xmen Real 11-Mar-09 4:02 
QuestionProblem sending EMail Pin
Pankaj Garg10-Mar-09 22:33
Pankaj Garg10-Mar-09 22:33 
Generalhi all Pin
vickyjohn10-Mar-09 20:39
vickyjohn10-Mar-09 20:39 
GeneralRe: hi all Pin
Tom Deketelaere10-Mar-09 23:05
professionalTom Deketelaere10-Mar-09 23:05 
GeneralRe: hi all Pin
Ashfield11-Mar-09 3:16
Ashfield11-Mar-09 3:16 
QuestionCompare two Table Pin
zaimah10-Mar-09 18:18
zaimah10-Mar-09 18:18 
AnswerRe: Compare two Table Pin
Luc Pattyn10-Mar-09 18:47
sitebuilderLuc Pattyn10-Mar-09 18:47 
GeneralRe: Compare two Table Pin
zaimah10-Mar-09 19:03
zaimah10-Mar-09 19:03 
GeneralRe: Compare two Table Pin
Sebastian Br.10-Mar-09 21:26
Sebastian Br.10-Mar-09 21:26 
GeneralRe: Compare two Table Pin
zaimah10-Mar-09 21:55
zaimah10-Mar-09 21:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.