They are both different things. The
SuppressFinalize(this)
call will prevent the garbage collector from calling the the
Finalize
method for the specified object, also see the
documentation[
^] on that.
The
WaitForPendingFinalizers[
^] will block the calling thread until all finalizers have been called.
However, I do advise you to tread carefully when calling this. In some cases this might be necessary, but I would first look into
why you're getting an
OutOfMemoryException
before calling the garbage collector.