diff --git a/src/BenchmarkDotNet/Engines/Engine.cs b/src/BenchmarkDotNet/Engines/Engine.cs index f271783590..bb238d8499 100644 --- a/src/BenchmarkDotNet/Engines/Engine.cs +++ b/src/BenchmarkDotNet/Engines/Engine.cs @@ -230,7 +230,8 @@ private ClockSpan Measure(Action action, long invokeCount) // #1542 // We put the current thread to sleep so tiered jit can kick in, compile its stuff, // and NOT allocate anything on the background thread when we are measuring allocations. - // This is only an issue on netcoreapp3.0 to net6.0. Tiered jit allocations were fixed in net7.0, + // This is only an issue on netcoreapp3.0 to net6.0. Tiered jit allocations were "fixed" in net7.0 + // (maybe not completely eliminated forever, but at least reduced to a point where measurements are much more stable), // and netcoreapp2.X uses only GetAllocatedBytesForCurrentThread which doesn't capture the tiered jit allocations. Thread.Sleep(TimeSpan.FromMilliseconds(500)); } diff --git a/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs b/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs index 6562c95f2b..a3567eca55 100755 --- a/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs @@ -29,7 +29,7 @@ namespace BenchmarkDotNet.IntegrationTests public class MemoryDiagnoserTests { // TODO: re-enable allocating tests after https://github.com/dotnet/runtime/issues/101536 is fixed. - private const string AllocatingSkipReason = "System.Runtime.InteropServices.RuntimeInformation allocates during GC collect"; + private const string AllocatingSkipReason = "GC collect causes allocations on finalizer thread"; private readonly ITestOutputHelper output;