views:

97

answers:

1

Hello, I have situation when GC has not time to delete free objects, how to tune GC or may be are there best practices for tunning GC ? Thanks.


code reads big document into memory and processes it, so in one of method presents loop where doing process of this document. If I stopped in this loop(in debug mode) or add GC.Collect() memory less then 70 MB.

+2  A: 

The best tuning here is to leave it alone.

But if your process is really blocking the GC all the time (it shouldn't), it could help to call GC.Collect() after some memory consuming part finishes.

But we need a lot more info here. What type of application, why (do you think) the GC has no time to do it normally?

Henk Holterman
yes, I know about it, but call Collect method is bed practice or isn't ?
jitm
@jitm: Yes it in general a bad practice. You need to provide a lot more info before someone can say if it would be a solution for you.
Henk Holterman
I've added some informations as comment above. In general process big file in memory.
jitm
Thanks, I've found problem place in code.
jitm