diff options
author | UbitUmarov | 2015-11-24 11:22:40 +0000 |
---|---|---|
committer | UbitUmarov | 2015-11-24 11:22:40 +0000 |
commit | 19b96697a601ff84c84ce6ce81927bc2281dbcc0 (patch) | |
tree | 42ac7ef456afe874326efdfad1433bdd729066c4 /OpenSim/Framework/Monitoring/BaseStatsCollector.cs | |
parent | Flipped version to 0.9.0.0 (diff) | |
download | opensim-SC_OLD-19b96697a601ff84c84ce6ce81927bc2281dbcc0.zip opensim-SC_OLD-19b96697a601ff84c84ce6ce81927bc2281dbcc0.tar.gz opensim-SC_OLD-19b96697a601ff84c84ce6ce81927bc2281dbcc0.tar.bz2 opensim-SC_OLD-19b96697a601ff84c84ce6ce81927bc2281dbcc0.tar.xz |
try not to use Process.HasExit that is broken in some mono versions
Diffstat (limited to 'OpenSim/Framework/Monitoring/BaseStatsCollector.cs')
-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 | } |