diff options
author | Melanie | 2012-07-11 04:03:28 +0200 |
---|---|---|
committer | Melanie | 2012-07-11 04:03:28 +0200 |
commit | b3910a44fa7d8756dabd4bb2434f7551b7a0dc60 (patch) | |
tree | ba1df16bb3079983ca25e5f1b0532eff81159c66 | |
parent | Merge branch 'ubitwork' into avination (diff) | |
parent | Make sure handles stay intact when removing from the MinHeap (diff) | |
download | opensim-SC_OLD-b3910a44fa7d8756dabd4bb2434f7551b7a0dc60.zip opensim-SC_OLD-b3910a44fa7d8756dabd4bb2434f7551b7a0dc60.tar.gz opensim-SC_OLD-b3910a44fa7d8756dabd4bb2434f7551b7a0dc60.tar.bz2 opensim-SC_OLD-b3910a44fa7d8756dabd4bb2434f7551b7a0dc60.tar.xz |
Merge branch 'ubitwork' into avination
-rw-r--r-- | OpenSim/Framework/MinHeap.cs | 12 | ||||
-rw-r--r-- | OpenSim/Framework/Statistics/BaseStatsCollector.cs | 24 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 16 |
4 files changed, 40 insertions, 14 deletions
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 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index a600b86..0587846 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1820,6 +1820,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1820 | { | 1820 | { |
1821 | parentGroup.LinkToGroup(child); | 1821 | parentGroup.LinkToGroup(child); |
1822 | 1822 | ||
1823 | child.DetachFromBackup(); | ||
1824 | |||
1823 | // this is here so physics gets updated! | 1825 | // this is here so physics gets updated! |
1824 | // Don't remove! Bad juju! Stay away! or fix physics! | 1826 | // Don't remove! Bad juju! Stay away! or fix physics! |
1825 | child.AbsolutePosition = child.AbsolutePosition; | 1827 | child.AbsolutePosition = child.AbsolutePosition; |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 1e0f01f..2a01fc4 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -596,7 +596,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
596 | if (!m_Enabled) | 596 | if (!m_Enabled) |
597 | return; | 597 | return; |
598 | lockScriptsForRead(true); | 598 | lockScriptsForRead(true); |
599 | foreach (IScriptInstance instance in m_Scripts.Values) | 599 | |
600 | List<IScriptInstance> instancesToDel = new List<IScriptInstance>(m_Scripts.Values); | ||
601 | |||
602 | // foreach (IScriptInstance instance in m_Scripts.Values) | ||
603 | foreach (IScriptInstance instance in instancesToDel) | ||
600 | { | 604 | { |
601 | // Force a final state save | 605 | // Force a final state save |
602 | // | 606 | // |
@@ -619,7 +623,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
619 | // Must be done explicitly because they have infinite | 623 | // Must be done explicitly because they have infinite |
620 | // lifetime | 624 | // lifetime |
621 | // | 625 | // |
622 | if (!m_SimulatorShuttingDown) | 626 | // if (!m_SimulatorShuttingDown) |
623 | { | 627 | { |
624 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); | 628 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); |
625 | if (m_DomainScripts[instance.AppDomain].Count == 0) | 629 | if (m_DomainScripts[instance.AppDomain].Count == 0) |
@@ -629,10 +633,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
629 | } | 633 | } |
630 | } | 634 | } |
631 | 635 | ||
632 | m_Scripts.Clear(); | 636 | // m_Scripts.Clear(); |
633 | m_PrimObjects.Clear(); | 637 | // m_PrimObjects.Clear(); |
634 | m_Assemblies.Clear(); | 638 | // m_Assemblies.Clear(); |
635 | m_DomainScripts.Clear(); | 639 | // m_DomainScripts.Clear(); |
636 | } | 640 | } |
637 | lockScriptsForRead(false); | 641 | lockScriptsForRead(false); |
638 | lockScriptsForWrite(true); | 642 | lockScriptsForWrite(true); |