Are there any differences in the garbage collector for vb.net and C #?

I heard that the C # garbage collector may be "more aggressive" than its counterpart vb.net. It's true? Are there other differences in how garbage collection is done in vb.net or C #?

+5
source share
5 answers

I understand that the CLR supports garbage collection and is language independent.

+7
source

CLR . , , , . VB.NET , , , , GC, , #. .

+6

CLR , CLR - .

+5

- . , . vb.net Object.Finalize() Sub Overrides Finalize(). Object.Finalize. # Object.Finalize() . , "" ( , ), Finalize() :

override void Finalize(void)
{
  try
  {
    .. supplied code here
  }
  finally
  {
    base.Finalize();
  }
}

The intended purpose of the language construct is to make the completion code platform-independent. In practice, this is simply stupid, because any code that uses finalizers correctly will have to use platform-specific methods, such as GC.KeepAlive()and GC.SuppressFinalize().

+1
source

All Articles