Strange .NET 4.5 version-specific garbage collection issue with arrays

861 Views Asked by At

In my project, I have strange bug in my unit tests, which happens only when I use .NET 4.5, but not when 4.0. Here is source code of my project. Here is compiled binaries.

Steps to reproduce:

  1. Download source code and compiled binaries
  2. Place unzipped Binary folder in Interop\Main\ folder.
  3. Run Interop.Core.Tests.NETFX45 unit tests

Test IsAliveAfterCollectionWork must fail. If you attach memory profiler (I use free dotMemory 4.0 EAP with settings Profile .NET process -> Collection every N-th object: 1, Memory traffic: Collect and Use profiler API), you will see, that array MarkedObject[] has not been collected, although nothing has no references to it.

My configuraton:

  • Windows 8.1
  • .NET Framework 4.5.1
  • I use Visual Studio 2012, but 2010 and 2013 installed too
0

There are 0 best solutions below