From c6f06f1bd58b34f8fb4a9fcfccee080ad20beb70 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Sun, 4 Feb 2018 08:10:52 +0100 Subject: [PATCH] Don't force full collection on memory request Since this can be called quite often (like each 5 seconds), ASF should not do any expensive things there. Let GC do its job. --- ArchiSteamFarm/Bot.cs | 2 +- ArchiSteamFarm/IPC.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index b3cea85eb..05fac2a19 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -4244,7 +4244,7 @@ namespace ArchiSteamFarm { return null; } - ushort memoryInMegabytes = (ushort) (GC.GetTotalMemory(true) / 1024 / 1024); + ushort memoryInMegabytes = (ushort) (GC.GetTotalMemory(false) / 1024 / 1024); return FormatBotResponse(string.Format(Strings.BotStats, memoryInMegabytes)); } diff --git a/ArchiSteamFarm/IPC.cs b/ArchiSteamFarm/IPC.cs index 50b5b53f7..ebe437659 100644 --- a/ArchiSteamFarm/IPC.cs +++ b/ArchiSteamFarm/IPC.cs @@ -191,7 +191,7 @@ namespace ArchiSteamFarm { return false; } - uint memoryUsage = (uint) GC.GetTotalMemory(true) / 1024; + uint memoryUsage = (uint) GC.GetTotalMemory(false) / 1024; DateTime processStartTime;