diff options
8 files changed, 39 insertions, 8 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpResponse.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpResponse.cs index d26b68a..aba15b0 100644 --- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpResponse.cs +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpResponse.cs | |||
@@ -118,8 +118,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
118 | /// </summary> | 118 | /// </summary> |
119 | string StatusDescription { get; set; } | 119 | string StatusDescription { get; set; } |
120 | 120 | ||
121 | // bool ReuseContext { get; set; } | ||
122 | |||
123 | /// <summary> | 121 | /// <summary> |
124 | /// Add a header field and content to the response. | 122 | /// Add a header field and content to the response. |
125 | /// </summary> | 123 | /// </summary> |
diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs index 3c2dce8..ff3c80d 100644 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs | |||
@@ -31,6 +31,7 @@ using System.Diagnostics; | |||
31 | using System.IO; | 31 | using System.IO; |
32 | using System.Linq; | 32 | using System.Linq; |
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using System.Runtime; | ||
34 | using System.Text; | 35 | using System.Text; |
35 | using System.Text.RegularExpressions; | 36 | using System.Text.RegularExpressions; |
36 | using System.Threading; | 37 | using System.Threading; |
@@ -508,7 +509,11 @@ namespace OpenSim.Framework.Servers | |||
508 | private void HandleForceGc(string module, string[] args) | 509 | private void HandleForceGc(string module, string[] args) |
509 | { | 510 | { |
510 | Notice("Manually invoking runtime garbage collection"); | 511 | Notice("Manually invoking runtime garbage collection"); |
512 | GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; | ||
511 | GC.Collect(); | 513 | GC.Collect(); |
514 | GC.WaitForPendingFinalizers(); | ||
515 | GC.Collect(); | ||
516 | GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.Default; | ||
512 | } | 517 | } |
513 | 518 | ||
514 | public virtual void HandleShow(string module, string[] cmd) | 519 | public virtual void HandleShow(string module, string[] cmd) |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index bd178c0..516c1e5 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -30,6 +30,7 @@ using System.Collections; | |||
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Net; | 31 | using System.Net; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Runtime; | ||
33 | using System.Text; | 34 | using System.Text; |
34 | using System.Threading; | 35 | using System.Threading; |
35 | using System.Timers; | 36 | using System.Timers; |
@@ -635,9 +636,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
635 | 636 | ||
636 | if(m_scene.GetNumberOfClients() == 0) | 637 | if(m_scene.GetNumberOfClients() == 0) |
637 | { | 638 | { |
639 | GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; | ||
638 | GC.Collect(); | 640 | GC.Collect(); |
639 | GC.WaitForPendingFinalizers(); | 641 | GC.WaitForPendingFinalizers(); |
640 | GC.Collect(); | 642 | GC.Collect(); |
643 | GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.Default; | ||
641 | } | 644 | } |
642 | } | 645 | } |
643 | 646 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs index 11c53d7..fe74cf1 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs | |||
@@ -30,6 +30,7 @@ using System.Collections.Generic; | |||
30 | using System.IO; | 30 | using System.IO; |
31 | using System.IO.Compression; | 31 | using System.IO.Compression; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Runtime; | ||
33 | using System.Text.RegularExpressions; | 34 | using System.Text.RegularExpressions; |
34 | using System.Threading; | 35 | using System.Threading; |
35 | using System.Xml; | 36 | using System.Xml; |
@@ -216,6 +217,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
216 | CloseArchive(e.Message); | 217 | CloseArchive(e.Message); |
217 | throw; | 218 | throw; |
218 | } | 219 | } |
220 | |||
221 | GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; | ||
222 | GC.Collect(); | ||
223 | GC.WaitForPendingFinalizers(); | ||
224 | GC.Collect(); | ||
225 | GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.Default; | ||
219 | } | 226 | } |
220 | 227 | ||
221 | private void ArchiveOneRegion(Scene scene, string regionDir, Dictionary<UUID, sbyte> assetUuids, | 228 | private void ArchiveOneRegion(Scene scene, string regionDir, Dictionary<UUID, sbyte> assetUuids, |
@@ -282,6 +289,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
282 | 289 | ||
283 | assetGatherer.GatherAll(); | 290 | assetGatherer.GatherAll(); |
284 | 291 | ||
292 | GC.Collect(); | ||
285 | int errors = assetGatherer.FailedUUIDs.Count; | 293 | int errors = assetGatherer.FailedUUIDs.Count; |
286 | m_log.DebugFormat( | 294 | m_log.DebugFormat( |
287 | "[ARCHIVER]: {0} region scene objects to save reference {1} possible assets", | 295 | "[ARCHIVER]: {0} region scene objects to save reference {1} possible assets", |
@@ -313,6 +321,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
313 | assetUuids[regionSettings.TerrainTexture4] = (sbyte)AssetType.Texture; | 321 | assetUuids[regionSettings.TerrainTexture4] = (sbyte)AssetType.Texture; |
314 | 322 | ||
315 | Save(scene, sceneObjects, regionDir); | 323 | Save(scene, sceneObjects, regionDir); |
324 | GC.Collect(); | ||
316 | } | 325 | } |
317 | 326 | ||
318 | /// <summary> | 327 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index 91f4dc3..6e81025 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | |||
@@ -133,6 +133,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
133 | m_timeOutTimer .AutoReset = false; | 133 | m_timeOutTimer .AutoReset = false; |
134 | m_timeOutTimer.Elapsed += OnTimeout; | 134 | m_timeOutTimer.Elapsed += OnTimeout; |
135 | m_timeout = false; | 135 | m_timeout = false; |
136 | int gccontrol = 0; | ||
136 | 137 | ||
137 | foreach (KeyValuePair<UUID, sbyte> kvp in m_uuids) | 138 | foreach (KeyValuePair<UUID, sbyte> kvp in m_uuids) |
138 | { | 139 | { |
@@ -161,6 +162,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
161 | 162 | ||
162 | m_foundAssetUuids.Add(asset.FullID); | 163 | m_foundAssetUuids.Add(asset.FullID); |
163 | m_assetsArchiver.WriteAsset(PostProcess(asset)); | 164 | m_assetsArchiver.WriteAsset(PostProcess(asset)); |
165 | if(++gccontrol > 5000) | ||
166 | { | ||
167 | gccontrol = 0; | ||
168 | GC.Collect(); | ||
169 | } | ||
164 | } | 170 | } |
165 | 171 | ||
166 | catch (Exception e) | 172 | catch (Exception e) |
@@ -180,6 +186,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
180 | m_log.DebugFormat("[ARCHIVER]: Successfully added {0} assets ({1} of total possible assets requested were not found, were damaged or were not assets)", | 186 | m_log.DebugFormat("[ARCHIVER]: Successfully added {0} assets ({1} of total possible assets requested were not found, were damaged or were not assets)", |
181 | m_foundAssetUuids.Count, totalerrors); | 187 | m_foundAssetUuids.Count, totalerrors); |
182 | 188 | ||
189 | GC.Collect(); | ||
183 | PerformAssetsRequestCallback(m_timeout); | 190 | PerformAssetsRequestCallback(m_timeout); |
184 | } | 191 | } |
185 | 192 | ||
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs index 82cc12c..975184a 100644 --- a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs | |||
@@ -31,6 +31,7 @@ using System.Drawing; | |||
31 | using System.Drawing.Imaging; | 31 | using System.Drawing.Imaging; |
32 | using System.IO; | 32 | using System.IO; |
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using System.Runtime; | ||
34 | 35 | ||
35 | using CSJ2K; | 36 | using CSJ2K; |
36 | using Nini.Config; | 37 | using Nini.Config; |
@@ -261,8 +262,11 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
261 | 262 | ||
262 | m_colors.Clear(); | 263 | m_colors.Clear(); |
263 | m_warpTextures.Clear(); | 264 | m_warpTextures.Clear(); |
265 | GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; | ||
264 | GC.Collect(); | 266 | GC.Collect(); |
265 | // m_log.Debug("[WARP 3D IMAGE MODULE]: GC.Collect()"); | 267 | GC.WaitForPendingFinalizers(); |
268 | GC.Collect(); | ||
269 | GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.Default; | ||
266 | 270 | ||
267 | return bitmap; | 271 | return bitmap; |
268 | } | 272 | } |
diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs index a1dd711..732735e 100644 --- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Runtime; | ||
31 | using System.Net; | 32 | using System.Net; |
32 | using System.IO; | 33 | using System.IO; |
33 | using System.Text; | 34 | using System.Text; |
@@ -214,9 +215,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
214 | m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue; | 215 | m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue; |
215 | m_scene.LoginLock = false; | 216 | m_scene.LoginLock = false; |
216 | 217 | ||
218 | GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; | ||
217 | GC.Collect(); | 219 | GC.Collect(); |
218 | GC.WaitForPendingFinalizers(); | 220 | GC.WaitForPendingFinalizers(); |
219 | GC.Collect(); | 221 | GC.Collect(); |
222 | GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.Default; | ||
220 | 223 | ||
221 | if (!m_scene.StartDisabled) | 224 | if (!m_scene.StartDisabled) |
222 | { | 225 | { |
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs index d0043ba..b020215 100644 --- a/OpenSim/Server/Base/ServerUtils.cs +++ b/OpenSim/Server/Base/ServerUtils.cs | |||
@@ -204,8 +204,7 @@ namespace OpenSim.Server.Base | |||
204 | xw.Flush(); | 204 | xw.Flush(); |
205 | 205 | ||
206 | ms.Seek(0, SeekOrigin.Begin); | 206 | ms.Seek(0, SeekOrigin.Begin); |
207 | byte[] ret = ms.GetBuffer(); | 207 | byte[] ret = ms.ToArray(); |
208 | Array.Resize(ref ret, (int)ms.Length); | ||
209 | 208 | ||
210 | return ret; | 209 | return ret; |
211 | } | 210 | } |
@@ -579,9 +578,12 @@ namespace OpenSim.Server.Base | |||
579 | // Try to read it | 578 | // Try to read it |
580 | try | 579 | try |
581 | { | 580 | { |
582 | XmlReader r = XmlReader.Create(url); | 581 | IConfigSource cs; |
583 | IConfigSource cs = new XmlConfigSource(r); | 582 | using( XmlReader r = XmlReader.Create(url)) |
584 | source.Merge(cs); | 583 | { |
584 | cs = new XmlConfigSource(r); | ||
585 | source.Merge(cs); | ||
586 | } | ||
585 | } | 587 | } |
586 | catch (Exception e) | 588 | catch (Exception e) |
587 | { | 589 | { |