From 57bd671e00535e8406050b3a3df2ed3b5c432a47 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 2 Dec 2018 17:29:13 +0000
Subject: stats heap allocation rate can negative

---
 OpenSim/Framework/Monitoring/MemoryWatchdog.cs | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Framework/Monitoring/MemoryWatchdog.cs b/OpenSim/Framework/Monitoring/MemoryWatchdog.cs
index c474622..f2e47f8 100644
--- a/OpenSim/Framework/Monitoring/MemoryWatchdog.cs
+++ b/OpenSim/Framework/Monitoring/MemoryWatchdog.cs
@@ -110,20 +110,17 @@ namespace OpenSim.Framework.Monitoring
             long memoryNow = GC.GetTotalMemory(false);
             long memoryDiff = memoryNow - m_lastUpdateMemory;
 
-            if (memoryDiff >= 0)
-            {
-                if (m_samples.Count >= m_maxSamples)
+            if (m_samples.Count >= m_maxSamples)
                     m_samples.Dequeue();
 
-                double elapsed = Util.EnvironmentTickCountSubtract(now, m_lastUpdateTick);
+            double elapsed = Util.EnvironmentTickCountSubtract(now, m_lastUpdateTick);
 
-                // This should never happen since it's not useful for updates to occur with no time elapsed, but
-                // protect ourselves from a divide-by-zero just in case.
-                if (elapsed == 0)
-                    return;
+            // This should never happen since it's not useful for updates to occur with no time elapsed, but
+            // protect ourselves from a divide-by-zero just in case.
+            if (elapsed == 0)
+                return;
 
-                m_samples.Enqueue(memoryDiff / (double)elapsed);
-            }
+            m_samples.Enqueue(memoryDiff / (double)elapsed);
 
             UpdateLastRecord(memoryNow, now);
         }
-- 
cgit v1.1