0

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

Billal Begueradj
  • 17,880
  • 38
  • 105
  • 123
Davit Karapetyan
  • 509
  • 1
  • 5
  • 12

2 Answers2

0

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

Essigwurst
  • 545
  • 10
  • 23
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
  • 126
  • 2
  • 10