diff options
Diffstat (limited to 'OpenSim/Framework/Monitoring')
-rw-r--r-- | OpenSim/Framework/Monitoring/BaseStatsCollector.cs | 34 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/Watchdog.cs | 2 |
2 files changed, 24 insertions, 12 deletions
diff --git a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs index 57a63ef..9ee0876 100644 --- a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs | |||
@@ -43,18 +43,30 @@ 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 | sb.Append( | ||
47 | string.Format( | ||
48 | "Allocated to OpenSim objects: {0} MB\n", | ||
49 | Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0))); | ||
46 | 50 | ||
47 | sb.AppendFormat( | 51 | Process myprocess = Process.GetCurrentProcess(); |
48 | "Allocated to OpenSim objects: {0} MB\n", | 52 | if (!myprocess.HasExited) |
49 | Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0)); | 53 | { |
50 | 54 | myprocess.Refresh(); | |
51 | sb.AppendFormat( | 55 | sb.Append( |
52 | "OpenSim object memory churn : {0} MB/s\n", | 56 | string.Format( |
53 | Math.Round((MemoryWatchdog.AverageMemoryChurn * 1000) / 1024.0 / 1024, 3)); | 57 | "Process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n", |
54 | 58 | Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0), | |
55 | sb.AppendFormat( | 59 | Math.Round(Process.GetCurrentProcess().PagedMemorySize64 / 1024.0 / 1024.0), |
56 | "Process memory : {0} MB\n", | 60 | Math.Round(Process.GetCurrentProcess().VirtualMemorySize64 / 1024.0 / 1024.0))); |
57 | Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0)); | 61 | sb.Append( |
62 | string.Format( | ||
63 | "Peak process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n", | ||
64 | Math.Round(Process.GetCurrentProcess().PeakWorkingSet64 / 1024.0 / 1024.0), | ||
65 | Math.Round(Process.GetCurrentProcess().PeakPagedMemorySize64 / 1024.0 / 1024.0), | ||
66 | Math.Round(Process.GetCurrentProcess().PeakVirtualMemorySize64 / 1024.0 / 1024.0))); | ||
67 | } | ||
68 | else | ||
69 | sb.Append("Process reported as Exited \n"); | ||
58 | 70 | ||
59 | return sb.ToString(); | 71 | return sb.ToString(); |
60 | } | 72 | } |
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs index d4cf02f..e4db964 100644 --- a/OpenSim/Framework/Monitoring/Watchdog.cs +++ b/OpenSim/Framework/Monitoring/Watchdog.cs | |||
@@ -331,4 +331,4 @@ namespace OpenSim.Framework.Monitoring | |||
331 | m_watchdogTimer.Start(); | 331 | m_watchdogTimer.Start(); |
332 | } | 332 | } |
333 | } | 333 | } |
334 | } \ No newline at end of file | 334 | } |