aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorUbitUmarov2018-12-02 17:29:13 +0000
committerUbitUmarov2018-12-02 17:29:13 +0000
commit57bd671e00535e8406050b3a3df2ed3b5c432a47 (patch)
tree2a982010140aa60fd78fc487bc580cd72a8ab126 /OpenSim/Framework
parentavoid a data copy (diff)
downloadopensim-SC-57bd671e00535e8406050b3a3df2ed3b5c432a47.zip
opensim-SC-57bd671e00535e8406050b3a3df2ed3b5c432a47.tar.gz
opensim-SC-57bd671e00535e8406050b3a3df2ed3b5c432a47.tar.bz2
opensim-SC-57bd671e00535e8406050b3a3df2ed3b5c432a47.tar.xz
stats heap allocation rate can negative
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Monitoring/MemoryWatchdog.cs17
1 files changed, 7 insertions, 10 deletions
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
110 long memoryNow = GC.GetTotalMemory(false); 110 long memoryNow = GC.GetTotalMemory(false);
111 long memoryDiff = memoryNow - m_lastUpdateMemory; 111 long memoryDiff = memoryNow - m_lastUpdateMemory;
112 112
113 if (memoryDiff >= 0) 113 if (m_samples.Count >= m_maxSamples)
114 {
115 if (m_samples.Count >= m_maxSamples)
116 m_samples.Dequeue(); 114 m_samples.Dequeue();
117 115
118 double elapsed = Util.EnvironmentTickCountSubtract(now, m_lastUpdateTick); 116 double elapsed = Util.EnvironmentTickCountSubtract(now, m_lastUpdateTick);
119 117
120 // This should never happen since it's not useful for updates to occur with no time elapsed, but 118 // This should never happen since it's not useful for updates to occur with no time elapsed, but
121 // protect ourselves from a divide-by-zero just in case. 119 // protect ourselves from a divide-by-zero just in case.
122 if (elapsed == 0) 120 if (elapsed == 0)
123 return; 121 return;
124 122
125 m_samples.Enqueue(memoryDiff / (double)elapsed); 123 m_samples.Enqueue(memoryDiff / (double)elapsed);
126 }
127 124
128 UpdateLastRecord(memoryNow, now); 125 UpdateLastRecord(memoryNow, now);
129 } 126 }