Skip to content

Commit d351f0e

Browse files
committed
Removed enable monitoring in engine (GcStats handles it).
1 parent 07c4054 commit d351f0e

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/BenchmarkDotNet/Engines/Engine.cs

-14
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,6 @@ private ClockSpan Measure(Action<long> action, long invokeCount)
216216
[MethodImpl(CodeGenHelper.AggressiveOptimizationOption)]
217217
private (GcStats, ThreadingStats, double) GetExtraStats(IterationData data)
218218
{
219-
// we enable monitoring after main target run, for this single iteration which is executed at the end
220-
// so even if we enable AppDomain monitoring in separate process
221-
// it does not matter, because we have already obtained the results!
222-
EnableMonitoring();
223-
224219
// Warm up the GetAllocatedBytes function before starting the actual measurement.
225220
DeadCodeEliminationHelper.KeepAliveWithoutBoxing(GcStats.ReadInitial());
226221

@@ -285,15 +280,6 @@ internal static void ForceGcCollect()
285280

286281
public void WriteLine() => Host.WriteLine();
287282

288-
private static void EnableMonitoring()
289-
{
290-
if (RuntimeInformation.IsOldMono) // Monitoring is not available in Mono, see http://stackoverflow.com/questions/40234948/how-to-get-the-number-of-allocated-bytes-in-mono
291-
return;
292-
293-
if (RuntimeInformation.IsFullFramework)
294-
AppDomain.MonitoringIsEnabled = true;
295-
}
296-
297283
[UsedImplicitly]
298284
public static class Signals
299285
{

0 commit comments

Comments
 (0)