aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Monitoring/BaseStatsCollector.cs
diff options
context:
space:
mode:
authoronefang2019-05-19 21:24:15 +1000
committeronefang2019-05-19 21:24:15 +1000
commit5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch)
treea9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Framework/Monitoring/BaseStatsCollector.cs
parentAdd a build script. (diff)
downloadopensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip
opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz
opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2
opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Framework/Monitoring/BaseStatsCollector.cs')
-rw-r--r--OpenSim/Framework/Monitoring/BaseStatsCollector.cs26
1 files changed, 21 insertions, 5 deletions
diff --git a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs
index 20495f6..e513abd 100644
--- a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs
+++ b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs
@@ -43,7 +43,6 @@ namespace OpenSim.Framework.Monitoring
43 StringBuilder sb = new StringBuilder(Environment.NewLine); 43 StringBuilder sb = new StringBuilder(Environment.NewLine);
44 sb.Append("MEMORY STATISTICS"); 44 sb.Append("MEMORY STATISTICS");
45 sb.Append(Environment.NewLine); 45 sb.Append(Environment.NewLine);
46
47 sb.AppendFormat( 46 sb.AppendFormat(
48 "Heap allocated to OpenSim : {0} MB\n", 47 "Heap allocated to OpenSim : {0} MB\n",
49 Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0)); 48 Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0));
@@ -56,13 +55,30 @@ namespace OpenSim.Framework.Monitoring
56 "Average heap allocation rate: {0} MB/s\n", 55 "Average heap allocation rate: {0} MB/s\n",
57 Math.Round((MemoryWatchdog.AverageHeapAllocationRate * 1000) / 1024.0 / 1024, 3)); 56 Math.Round((MemoryWatchdog.AverageHeapAllocationRate * 1000) / 1024.0 / 1024, 3));
58 57
59 sb.AppendFormat( 58 Process myprocess = Process.GetCurrentProcess();
60 "Process memory : {0} MB\n", 59// if (!myprocess.HasExited)
61 Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0)); 60 try
61 {
62 myprocess.Refresh();
63 sb.AppendFormat(
64 "Process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n",
65 Math.Round(myprocess.WorkingSet64 / 1024.0 / 1024.0),
66 Math.Round(myprocess.PagedMemorySize64 / 1024.0 / 1024.0),
67 Math.Round(myprocess.VirtualMemorySize64 / 1024.0 / 1024.0));
68 sb.AppendFormat(
69 "Peak process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n",
70 Math.Round(myprocess.PeakWorkingSet64 / 1024.0 / 1024.0),
71 Math.Round(myprocess.PeakPagedMemorySize64 / 1024.0 / 1024.0),
72 Math.Round(myprocess.PeakVirtualMemorySize64 / 1024.0 / 1024.0));
73 }
74 catch
75 { }
76// else
77// sb.Append("Process reported as Exited \n");
62 78
63 return sb.ToString(); 79 return sb.ToString();
64 } 80 }
65 81
66 public virtual string XReport(string uptime, string version) 82 public virtual string XReport(string uptime, string version)
67 { 83 {
68 return (string) Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0).ToString() ; 84 return (string) Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0).ToString() ;