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

Dispose calling GC.Collect? Framework 1.0

P: n/a
Does anyone know of any case in which the CLR explicitly calls GC.Collect? I
have a form that when unloaded, shows # of induced GC's incremented by 5.
This is killing performance.

I have a feeling that it's related to calling Dispose on a particular
control class like DataGrid, ListView, etc.

TIA,
Eric

Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Eric,

The CLR can collect at any time. I think what you meant to say was does
anyone know a case where a class in the framework calls GC.Collect? I think
that there are some that do this (especially ones that are using COM
interop), but I would not say that it is outside the realm of possibility
that it could be calling this.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Eric Cadwell" <ec******@ns.insight.com> wrote in message
news:uT**************@TK2MSFTNGP11.phx.gbl...
Does anyone know of any case in which the CLR explicitly calls GC.Collect? I have a form that when unloaded, shows # of induced GC's incremented by 5.
This is killing performance.

I have a feeling that it's related to calling Dispose on a particular
control class like DataGrid, ListView, etc.

TIA,
Eric

Nov 15 '05 #2

P: n/a
Yes that is what I was fishing for, but it appears that it may not be
related to calling Dispose. In fact it is happening during the load of my
form!

Performance Monitor is showing an increase in # of induced GC of 6 per load
of a single form in my application. I have no explicit calls to GC in my
code.

Thanks,
-Eric
"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> wrote
in message news:uX**************@TK2MSFTNGP12.phx.gbl...
Eric,

The CLR can collect at any time. I think what you meant to say was does anyone know a case where a class in the framework calls GC.Collect? I think that there are some that do this (especially ones that are using COM
interop), but I would not say that it is outside the realm of possibility
that it could be calling this.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Eric Cadwell" <ec******@ns.insight.com> wrote in message
news:uT**************@TK2MSFTNGP11.phx.gbl...
Does anyone know of any case in which the CLR explicitly calls GC.Collect?
I
have a form that when unloaded, shows # of induced GC's incremented by

5. This is killing performance.

I have a feeling that it's related to calling Dispose on a particular
control class like DataGrid, ListView, etc.

TIA,
Eric


Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.