mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
add a few more gc collect in some spots
This commit is contained in:
@@ -30,6 +30,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Reflection;
|
||||
using System.Runtime;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Xml;
|
||||
@@ -216,6 +217,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
CloseArchive(e.Message);
|
||||
throw;
|
||||
}
|
||||
|
||||
GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
GC.Collect();
|
||||
GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.Default;
|
||||
}
|
||||
|
||||
private void ArchiveOneRegion(Scene scene, string regionDir, Dictionary<UUID, sbyte> assetUuids,
|
||||
@@ -282,6 +289,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
|
||||
assetGatherer.GatherAll();
|
||||
|
||||
GC.Collect();
|
||||
int errors = assetGatherer.FailedUUIDs.Count;
|
||||
m_log.DebugFormat(
|
||||
"[ARCHIVER]: {0} region scene objects to save reference {1} possible assets",
|
||||
@@ -313,6 +321,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
assetUuids[regionSettings.TerrainTexture4] = (sbyte)AssetType.Texture;
|
||||
|
||||
Save(scene, sceneObjects, regionDir);
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -133,6 +133,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
m_timeOutTimer .AutoReset = false;
|
||||
m_timeOutTimer.Elapsed += OnTimeout;
|
||||
m_timeout = false;
|
||||
int gccontrol = 0;
|
||||
|
||||
foreach (KeyValuePair<UUID, sbyte> kvp in m_uuids)
|
||||
{
|
||||
@@ -161,6 +162,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
|
||||
m_foundAssetUuids.Add(asset.FullID);
|
||||
m_assetsArchiver.WriteAsset(PostProcess(asset));
|
||||
if(++gccontrol > 5000)
|
||||
{
|
||||
gccontrol = 0;
|
||||
GC.Collect();
|
||||
}
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
@@ -180,6 +186,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
m_log.DebugFormat("[ARCHIVER]: Successfully added {0} assets ({1} of total possible assets requested were not found, were damaged or were not assets)",
|
||||
m_foundAssetUuids.Count, totalerrors);
|
||||
|
||||
GC.Collect();
|
||||
PerformAssetsRequestCallback(m_timeout);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime;
|
||||
|
||||
using CSJ2K;
|
||||
using Nini.Config;
|
||||
@@ -261,8 +262,11 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
|
||||
|
||||
m_colors.Clear();
|
||||
m_warpTextures.Clear();
|
||||
GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
|
||||
GC.Collect();
|
||||
// m_log.Debug("[WARP 3D IMAGE MODULE]: GC.Collect()");
|
||||
GC.WaitForPendingFinalizers();
|
||||
GC.Collect();
|
||||
GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.Default;
|
||||
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user