diff --git a/core/diagnostics/DiagnosticScenarios/Controllers/DiagnosticScenarios.cs b/core/diagnostics/DiagnosticScenarios/Controllers/DiagnosticScenarios.cs index ffaf974f33d..4e39f71058f 100644 --- a/core/diagnostics/DiagnosticScenarios/Controllers/DiagnosticScenarios.cs +++ b/core/diagnostics/DiagnosticScenarios/Controllers/DiagnosticScenarios.cs @@ -82,8 +82,9 @@ public ActionResult memspike(int seconds) // Cleanup p = null; - // Call GC.Collect twice + // GC GC.Collect(); + GC.WaitForPendingFinalizers(); GC.Collect(); Thread.Sleep(5000); // Sleep for 5 seconds before spiking memory again