diff options
-rw-r--r-- | OpenSim/Framework/Monitoring/BaseStatsCollector.cs | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs index 96536e8..8c2bec6 100644 --- a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs | |||
@@ -56,22 +56,25 @@ namespace OpenSim.Framework.Monitoring | |||
56 | Math.Round((MemoryWatchdog.AverageHeapAllocationRate * 1000) / 1024.0 / 1024, 3)); | 56 | Math.Round((MemoryWatchdog.AverageHeapAllocationRate * 1000) / 1024.0 / 1024, 3)); |
57 | 57 | ||
58 | Process myprocess = Process.GetCurrentProcess(); | 58 | Process myprocess = Process.GetCurrentProcess(); |
59 | if (!myprocess.HasExited) | 59 | // if (!myprocess.HasExited) |
60 | try | ||
60 | { | 61 | { |
61 | myprocess.Refresh(); | 62 | myprocess.Refresh(); |
62 | sb.AppendFormat( | 63 | sb.AppendFormat( |
63 | "Process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n", | 64 | "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(myprocess.WorkingSet64 / 1024.0 / 1024.0), |
65 | Math.Round(Process.GetCurrentProcess().PagedMemorySize64 / 1024.0 / 1024.0), | 66 | Math.Round(myprocess.PagedMemorySize64 / 1024.0 / 1024.0), |
66 | Math.Round(Process.GetCurrentProcess().VirtualMemorySize64 / 1024.0 / 1024.0)); | 67 | Math.Round(myprocess.VirtualMemorySize64 / 1024.0 / 1024.0)); |
67 | sb.AppendFormat( | 68 | sb.AppendFormat( |
68 | "Peak process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n", | 69 | "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(myprocess.PeakWorkingSet64 / 1024.0 / 1024.0), |
70 | Math.Round(Process.GetCurrentProcess().PeakPagedMemorySize64 / 1024.0 / 1024.0), | 71 | Math.Round(myprocess.PeakPagedMemorySize64 / 1024.0 / 1024.0), |
71 | Math.Round(Process.GetCurrentProcess().PeakVirtualMemorySize64 / 1024.0 / 1024.0)); | 72 | Math.Round(myprocess.PeakVirtualMemorySize64 / 1024.0 / 1024.0)); |
72 | } | 73 | } |
73 | else | 74 | catch |
74 | sb.Append("Process reported as Exited \n"); | 75 | { } |
76 | // else | ||
77 | // sb.Append("Process reported as Exited \n"); | ||
75 | 78 | ||
76 | return sb.ToString(); | 79 | return sb.ToString(); |
77 | } | 80 | } |