From 0ba00a18450994716dbc27fa6bb1fe5fb7c0029d Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Tue, 29 Dec 2020 14:10:15 +0100 Subject: [PATCH] Gcf command to mess with LOH compaction. --- Robust.Client/Console/Commands/Debug.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Robust.Client/Console/Commands/Debug.cs b/Robust.Client/Console/Commands/Debug.cs index 94c8a16c817..681723ee389 100644 --- a/Robust.Client/Console/Commands/Debug.cs +++ b/Robust.Client/Console/Commands/Debug.cs @@ -781,6 +781,21 @@ public bool Execute(IDebugConsole console, params string[] args) } } + internal class GcFullCommand : IConsoleCommand + { + public string Command => "gcf"; + public string Description => "Run the GC, fully, compacting LOH and everything."; + public string Help => "gcf"; + + public bool Execute(IDebugConsole console, params string[] args) + { + GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; + GC.Collect(2, GCCollectionMode.Forced, true, true); + + return false; + } + } + internal class GcModeCommand : IConsoleCommand {