diff options
author | Justin Clark-Casey (justincc) | 2012-07-25 22:29:40 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-25 22:29:40 +0100 |
commit | a1e99642c19810f98084e77723df1e242d2c26d0 (patch) | |
tree | 24884797a683355fa862621310d82f37067c7813 /OpenSim/Framework/Statistics | |
parent | Make SceneManager.OnRegionsReadyStatusChange event available. (diff) | |
download | opensim-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 '')
-rw-r--r-- | OpenSim/Framework/Statistics/BaseStatsCollector.cs | 20 |
1 files changed, 12 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 | } |