0

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

Billal Begueradj
  • 20,717
  • 43
  • 112
  • 130
Davit Karapetyan
  • 589
  • 1
  • 6
  • 14

2 Answers2

0

You may try GC.Collect() and then GC.WaitForPendingFinalizers(); else i don't think it's possible..

Essigwurst
  • 555
  • 10
  • 24
0

You can specify the generation when calling Collect method

GC.Collect(1);

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:

Community
  • 1
  • 1
wmioduszewski
  • 146
  • 2
  • 10