diff --git a/src/BenchmarkDotNet.Core/Engines/Engine.cs b/src/BenchmarkDotNet.Core/Engines/Engine.cs index eebabbfcba..3b84b84cd7 100644 --- a/src/BenchmarkDotNet.Core/Engines/Engine.cs +++ b/src/BenchmarkDotNet.Core/Engines/Engine.cs @@ -120,8 +120,8 @@ public RunResults Run() // we enable monitoring after pilot & warmup, just to ignore the memory allocated by these runs EnableMonitoring(); - var initialGcStats = GcStats.ReadInitial(IsDiagnoserAttached); if(IsDiagnoserAttached) Host.BeforeMainRun(); + var initialGcStats = GcStats.ReadInitial(IsDiagnoserAttached); var main = targetStage.RunMain(invokeCount, UnrollFactor, forceSpecific: Strategy == RunStrategy.Monitoring);