What is the Use of System.GC.Collect()
ASP.NET
2
Posts
2
Posters
0
Views
1
Watching
-
.Net is having default garbage collection. what is the advantage of using System.GC.Collect().
-
.Net is having default garbage collection. what is the advantage of using System.GC.Collect().
Member 3057887 wrote:
.Net is having default garbage collection. what is the advantage of using System.GC.Collect().
.NET garbage collector won't run always and you can't predict when it will run.
GC.Collect()
invokes the garbage collector and forcing for a cleanup. It is not recommended to use it unless you know what you are doing. WhenGC.Collect()
is called, it freezes all executing threads until it finishes. This may degrade your application performance.Navaneeth How to use google | Ask smart questions