diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Util.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 03e8852..e0e35db 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -2485,7 +2485,10 @@ namespace OpenSim.Framework | |||
2485 | case FireAndForgetMethod.SmartThreadPool: | 2485 | case FireAndForgetMethod.SmartThreadPool: |
2486 | return m_ThreadPool.MaxThreads - m_ThreadPool.InUseThreads; | 2486 | return m_ThreadPool.MaxThreads - m_ThreadPool.InUseThreads; |
2487 | case FireAndForgetMethod.Thread: | 2487 | case FireAndForgetMethod.Thread: |
2488 | return MAX_SYSTEM_THREADS - System.Diagnostics.Process.GetCurrentProcess().Threads.Count; | 2488 | { |
2489 | using(Process p = System.Diagnostics.Process.GetCurrentProcess()) | ||
2490 | return MAX_SYSTEM_THREADS - p.Threads.Count; | ||
2491 | } | ||
2489 | default: | 2492 | default: |
2490 | throw new NotImplementedException(); | 2493 | throw new NotImplementedException(); |
2491 | } | 2494 | } |
@@ -2972,7 +2975,8 @@ namespace OpenSim.Framework | |||
2972 | 2975 | ||
2973 | public static long GetPhysicalMemUse() | 2976 | public static long GetPhysicalMemUse() |
2974 | { | 2977 | { |
2975 | return System.Diagnostics.Process.GetCurrentProcess().WorkingSet64; | 2978 | using (Process p = System.Diagnostics.Process.GetCurrentProcess()) |
2979 | return p.WorkingSet64; | ||
2976 | } | 2980 | } |
2977 | 2981 | ||
2978 | // returns a timestamp in ms as double | 2982 | // returns a timestamp in ms as double |