aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorMelanie2012-07-11 14:27:33 +0100
committerMelanie2012-07-11 14:27:33 +0100
commit89c9528e38b4e06a2af6231ced4ed733bbafa174 (patch)
treeaed380f4bc51d9102e593446762f476694b9d87c /OpenSim/Framework
parentMerge branch 'master' into careminster (diff)
parent remove expensive and leaked ( in Xengine at least) SayShout timer and (diff)
downloadopensim-SC-89c9528e38b4e06a2af6231ced4ed733bbafa174.zip
opensim-SC-89c9528e38b4e06a2af6231ced4ed733bbafa174.tar.gz
opensim-SC-89c9528e38b4e06a2af6231ced4ed733bbafa174.tar.bz2
opensim-SC-89c9528e38b4e06a2af6231ced4ed733bbafa174.tar.xz
Merge branch 'avination' into careminster
Conflicts: OpenSim/Data/MySQL/MySQLSimulationData.cs
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/LocklessQueue.cs11
-rw-r--r--OpenSim/Framework/MinHeap.cs12
-rw-r--r--OpenSim/Framework/Statistics/BaseStatsCollector.cs24
3 files changed, 38 insertions, 9 deletions
diff --git a/OpenSim/Framework/LocklessQueue.cs b/OpenSim/Framework/LocklessQueue.cs
index dd3d201..84f887c 100644
--- a/OpenSim/Framework/LocklessQueue.cs
+++ b/OpenSim/Framework/LocklessQueue.cs
@@ -99,8 +99,13 @@ namespace OpenSim.Framework
99 } 99 }
100 else 100 else
101 { 101 {
102 item = oldHeadNext.Item; 102 item = oldHeadNext.Item;
103 haveAdvancedHead = CAS(ref head, oldHead, oldHeadNext); 103 haveAdvancedHead = CAS(ref head, oldHead, oldHeadNext);
104 if (haveAdvancedHead)
105 {
106 oldHeadNext.Item = default(T);
107 oldHead.Next = null;
108 }
104 } 109 }
105 } 110 }
106 } 111 }
@@ -111,6 +116,10 @@ namespace OpenSim.Framework
111 116
112 public void Clear() 117 public void Clear()
113 { 118 {
119 // ugly
120 T item;
121 while(count > 0)
122 Dequeue(out item);
114 Init(); 123 Init();
115 } 124 }
116 125
diff --git a/OpenSim/Framework/MinHeap.cs b/OpenSim/Framework/MinHeap.cs
index 33d0364..99ac25d 100644
--- a/OpenSim/Framework/MinHeap.cs
+++ b/OpenSim/Framework/MinHeap.cs
@@ -63,12 +63,15 @@ namespace OpenSim.Framework
63 63
64 internal void Clear() 64 internal void Clear()
65 { 65 {
66 this.value = default(T);
67 if (this.handle != null) 66 if (this.handle != null)
68 {
69 this.handle.Clear(); 67 this.handle.Clear();
70 this.handle = null; 68 ClearRef();
71 } 69 }
70
71 internal void ClearRef()
72 {
73 this.value = default(T);
74 this.handle = null;
72 } 75 }
73 } 76 }
74 77
@@ -285,6 +288,7 @@ namespace OpenSim.Framework
285 if (--this.size > 0 && index != this.size) 288 if (--this.size > 0 && index != this.size)
286 { 289 {
287 Set(this.items[this.size], index); 290 Set(this.items[this.size], index);
291 this.items[this.size].ClearRef();
288 if (!BubbleUp(index)) 292 if (!BubbleUp(index))
289 BubbleDown(index); 293 BubbleDown(index);
290 } 294 }
diff --git a/OpenSim/Framework/Statistics/BaseStatsCollector.cs b/OpenSim/Framework/Statistics/BaseStatsCollector.cs
index c9e57ce..3f918f3 100644
--- a/OpenSim/Framework/Statistics/BaseStatsCollector.cs
+++ b/OpenSim/Framework/Statistics/BaseStatsCollector.cs
@@ -48,10 +48,26 @@ namespace OpenSim.Framework.Statistics
48 string.Format( 48 string.Format(
49 "Allocated to OpenSim objects: {0} MB\n", 49 "Allocated to OpenSim objects: {0} MB\n",
50 Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0))); 50 Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0)));
51 sb.Append( 51
52 string.Format( 52 Process myprocess = Process.GetCurrentProcess();
53 "Process memory : {0} MB\n", 53 if (!myprocess.HasExited)
54 Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0))); 54 {
55 myprocess.Refresh();
56 sb.Append(
57 string.Format(
58 "Process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n",
59 Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0),
60 Math.Round(Process.GetCurrentProcess().PagedMemorySize64 / 1024.0 / 1024.0),
61 Math.Round(Process.GetCurrentProcess().VirtualMemorySize64 / 1024.0 / 1024.0)));
62 sb.Append(
63 string.Format(
64 "Peak process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n",
65 Math.Round(Process.GetCurrentProcess().PeakWorkingSet64 / 1024.0 / 1024.0),
66 Math.Round(Process.GetCurrentProcess().PeakPagedMemorySize64 / 1024.0 / 1024.0),
67 Math.Round(Process.GetCurrentProcess().PeakVirtualMemorySize64 / 1024.0 / 1024.0)));
68 }
69 else
70 sb.Append("Process reported as Exited \n");
55 71
56 return sb.ToString(); 72 return sb.ToString();
57 } 73 }