How do you make sure that the garbage collector is done running when you call GC.Collect()?

Advertisement

  • There is no way to find this out.
  • You cannot. GC.Collect() is a blocking method, and will return only once the garbage collector is done running.
  • by calling GC.WaitForFullGCComplete()
  • by calling GC.WaitForPendingFinalizers()
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment


Share via
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.