aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-07-25 22:29:40 +0100
committerJustin Clark-Casey (justincc)2012-07-25 22:29:40 +0100
commita1e99642c19810f98084e77723df1e242d2c26d0 (patch)
tree24884797a683355fa862621310d82f37067c7813 /OpenSim/Framework
parentMake SceneManager.OnRegionsReadyStatusChange event available. (diff)
downloadopensim-SC_OLD-a1e99642c19810f98084e77723df1e242d2c26d0.zip
opensim-SC_OLD-a1e99642c19810f98084e77723df1e242d2c26d0.tar.gz
opensim-SC_OLD-a1e99642c19810f98084e77723df1e242d2c26d0.tar.bz2
opensim-SC_OLD-a1e99642c19810f98084e77723df1e242d2c26d0.tar.xz
Add experimental "OpenSim object memory churn" statistics to output of region console "show stats" command
This aims to capture the amount of memory that OpenSim turns over whilst operating a region. This memory is not lost - apart from leaks it is reclaimed by the garbage collector. However, the more memory that gets turned over the more work the GC has to do to reclaim it.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Statistics/BaseStatsCollector.cs20
-rw-r--r--OpenSim/Framework/Watchdog.cs3
2 files changed, 15 insertions, 8 deletions
diff --git a/OpenSim/Framework/Statistics/BaseStatsCollector.cs b/OpenSim/Framework/Statistics/BaseStatsCollector.cs
index c9e57ce..28ce650 100644
--- a/OpenSim/Framework/Statistics/BaseStatsCollector.cs
+++ b/OpenSim/Framework/Statistics/BaseStatsCollector.cs
@@ -44,14 +44,18 @@ namespace OpenSim.Framework.Statistics
44 StringBuilder sb = new StringBuilder(Environment.NewLine); 44 StringBuilder sb = new StringBuilder(Environment.NewLine);
45 sb.Append("MEMORY STATISTICS"); 45 sb.Append("MEMORY STATISTICS");
46 sb.Append(Environment.NewLine); 46 sb.Append(Environment.NewLine);
47 sb.Append( 47
48 string.Format( 48 sb.AppendFormat(
49 "Allocated to OpenSim objects: {0} MB\n", 49 "Allocated to OpenSim objects: {0} MB\n",
50 Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0))); 50 Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0));
51 sb.Append( 51
52 string.Format( 52 sb.AppendFormat(
53 "Process memory : {0} MB\n", 53 "OpenSim object memory churn : {0} KB/s\n",
54 Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0))); 54 Math.Round((MemoryWatchdog.AverageMemoryChurn * 1000) / 1024.0 / 1024, 3));
55
56 sb.AppendFormat(
57 "Process memory : {0} MB\n",
58 Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0));
55 59
56 return sb.ToString(); 60 return sb.ToString();
57 } 61 }
diff --git a/OpenSim/Framework/Watchdog.cs b/OpenSim/Framework/Watchdog.cs
index 8a74f53..54e3d1a 100644
--- a/OpenSim/Framework/Watchdog.cs
+++ b/OpenSim/Framework/Watchdog.cs
@@ -325,6 +325,9 @@ namespace OpenSim.Framework
325 callback(callbackInfo); 325 callback(callbackInfo);
326 } 326 }
327 327
328 if (MemoryWatchdog.Enabled)
329 MemoryWatchdog.Update();
330
328 m_watchdogTimer.Start(); 331 m_watchdogTimer.Start();
329 } 332 }
330 } 333 }