As we know that during run time garbage collection request automatically when there is not enough space in memory to forming object. In my knowledge garbage collection call automatically, but when we do some programming in real world then it become indespensible to call garbage collection.let a example if we are making a programm in first step i want to call garbage collection for optimizing memory for further creation of object that means during run time. So how we will call garbage collector ?
As we know that during run time garbage collection request automatically when there is
Share
Generally you should not call GC.Collect yourself. The GC is self-tuning and will most likely do a much better job than you can as it can take account of the entire managed heap and its usage.
However, you may want to check the answers to this question as well.