Davit Karapetyan Davit Karapetyan - 8 months ago 48
C# Question

Can I call specific generation GC

I'm interested if we can specifically call full GC or level 1 GC ?


You can specify the generation when calling Collect method


As Essigwurst wrote - remember about calling GC.WaitForPendingFinalizers() afterwards. Bare in mind that explicitly collecting is not reccomended because of permormance issues. You can get more information in these threads: