Garbage Collector
-
I need to write code to force garbage collection and add whatever values i get in DB,How to go about it? Mini Thomas
-
I need to write code to force garbage collection and add whatever values i get in DB,How to go about it? Mini Thomas
You can start with System.GC.Collect(). There is an overload that will allow you to specify the generation to collect also. I highly recommend you let the GC do things by itself because forcing garbage collection messes up its tuning and timing.
█▒▒▒▒▒██▒█▒██ █▒█████▒▒▒▒▒█ █▒██████▒█▒██ █▒█████▒▒▒▒▒█ █▒▒▒▒▒██▒█▒██
-
You can start with System.GC.Collect(). There is an overload that will allow you to specify the generation to collect also. I highly recommend you let the GC do things by itself because forcing garbage collection messes up its tuning and timing.
█▒▒▒▒▒██▒█▒██ █▒█████▒▒▒▒▒█ █▒██████▒█▒██ █▒█████▒▒▒▒▒█ █▒▒▒▒▒██▒█▒██
i fully agree with you. Why you need explicit call to GC. Can you share the reason. ? Amit
-
i fully agree with you. Why you need explicit call to GC. Can you share the reason. ? Amit
I am writing a program to collect values u fetch from System.GC.Collect () into DB Mini Thomas
-
i fully agree with you. Why you need explicit call to GC. Can you share the reason. ? Amit
Amit Kumar G wrote:
i fully agree with you. Why you need explicit call to GC. Can you share the reason. ?
There may be a time when memory is critical and you need to clear it out but you cant wait on the GC to do it for you. These are rare cases along with any other cases where you would explicitly invoke the GC. I believe if you build your code to where you actually need to invoke the GC manually then you need to rethink your design.
█▒▒▒▒▒██▒█▒██ █▒█████▒▒▒▒▒█ █▒██████▒█▒██ █▒█████▒▒▒▒▒█ █▒▒▒▒▒██▒█▒██
-
I am writing a program to collect values u fetch from System.GC.Collect () into DB Mini Thomas