From 471d7ae40dc0484e5d83d4ffe2c49bdfe5e140a8 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Fri, 17 Nov 2017 18:18:38 +0000 Subject: [PATCH] Run GC more during loading. This helps reduce the peak GC size by trimming temporary loading garbage a bit more often, rather than just doing it at the end of loading. --- OpenRA.Game/Game.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index b76dee1b18..24c50ef1a7 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -170,9 +170,13 @@ namespace OpenRA worldRenderer = new WorldRenderer(ModData, OrderManager.World); + GC.Collect(); + using (new PerfTimer("LoadComplete")) OrderManager.World.LoadComplete(worldRenderer); + GC.Collect(); + if (OrderManager.GameStarted) return;