From bd12d60e80b6f051a9e4f4470c7621e5ad098380 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 20 Nov 2019 23:16:20 +0000 Subject: cosmetics --- OpenSim/Framework/Monitoring/BaseStatsCollector.cs | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'OpenSim/Framework/Monitoring/BaseStatsCollector.cs') diff --git a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs index b5df94b..7119964 100644 --- a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs @@ -52,21 +52,21 @@ namespace OpenSim.Framework.Monitoring Math.Round((MemoryWatchdog.LastHeapAllocationRate * 1000) / 1048576.0, 3), Math.Round((MemoryWatchdog.AverageHeapAllocationRate * 1000) / 1048576.0, 3)); - Process myprocess = Process.GetCurrentProcess(); -// if (!myprocess.HasExited) try { - myprocess.Refresh(); - sb.AppendFormat( - "Process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n", - Math.Round(myprocess.WorkingSet64 / 1024.0 / 1024.0), - Math.Round(myprocess.PagedMemorySize64 / 1024.0 / 1024.0), - Math.Round(myprocess.VirtualMemorySize64 / 1024.0 / 1024.0)); - sb.AppendFormat( - "Peak process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n", - Math.Round(myprocess.PeakWorkingSet64 / 1024.0 / 1024.0), - Math.Round(myprocess.PeakPagedMemorySize64 / 1024.0 / 1024.0), - Math.Round(myprocess.PeakVirtualMemorySize64 / 1024.0 / 1024.0)); + using (Process myprocess = Process.GetCurrentProcess()) + { + sb.AppendFormat( + "Process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n", + Math.Round(myprocess.WorkingSet64 / 1024.0 / 1024.0), + Math.Round(myprocess.PagedMemorySize64 / 1024.0 / 1024.0), + Math.Round(myprocess.VirtualMemorySize64 / 1024.0 / 1024.0)); + sb.AppendFormat( + "Peak process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n", + Math.Round(myprocess.PeakWorkingSet64 / 1024.0 / 1024.0), + Math.Round(myprocess.PeakPagedMemorySize64 / 1024.0 / 1024.0), + Math.Round(myprocess.PeakVirtualMemorySize64 / 1024.0 / 1024.0)); + } } catch { } -- cgit v1.1