diff options
Diffstat (limited to 'OpenSim/Framework/Monitoring/BaseStatsCollector.cs')
-rw-r--r-- | OpenSim/Framework/Monitoring/BaseStatsCollector.cs | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs index be1d02b..23dba09 100644 --- a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs | |||
@@ -43,10 +43,9 @@ 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 | "Allocated to OpenSim objects: {0} MB\n", | 47 | "Allocated to OpenSim objects: {0} MB\n", |
49 | Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0)); | 48 | Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0)); |
50 | 49 | ||
51 | sb.AppendFormat( | 50 | sb.AppendFormat( |
52 | "OpenSim last object memory churn : {0} MB/s\n", | 51 | "OpenSim last object memory churn : {0} MB/s\n", |
@@ -56,9 +55,23 @@ namespace OpenSim.Framework.Monitoring | |||
56 | "OpenSim average object memory churn : {0} MB/s\n", | 55 | "OpenSim average object memory churn : {0} MB/s\n", |
57 | Math.Round((MemoryWatchdog.AverageMemoryChurn * 1000) / 1024.0 / 1024, 3)); | 56 | Math.Round((MemoryWatchdog.AverageMemoryChurn * 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 | { |
61 | myprocess.Refresh(); | ||
62 | sb.AppendFormat( | ||
63 | "Process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n", | ||
64 | Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0), | ||
65 | Math.Round(Process.GetCurrentProcess().PagedMemorySize64 / 1024.0 / 1024.0), | ||
66 | Math.Round(Process.GetCurrentProcess().VirtualMemorySize64 / 1024.0 / 1024.0)); | ||
67 | sb.AppendFormat( | ||
68 | "Peak process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n", | ||
69 | Math.Round(Process.GetCurrentProcess().PeakWorkingSet64 / 1024.0 / 1024.0), | ||
70 | Math.Round(Process.GetCurrentProcess().PeakPagedMemorySize64 / 1024.0 / 1024.0), | ||
71 | Math.Round(Process.GetCurrentProcess().PeakVirtualMemorySize64 / 1024.0 / 1024.0)); | ||
72 | } | ||
73 | else | ||
74 | sb.Append("Process reported as Exited \n"); | ||
62 | 75 | ||
63 | return sb.ToString(); | 76 | return sb.ToString(); |
64 | } | 77 | } |