give up calling gc.collect on flotsamcache. Did nothing visible and has negative side effects

master
UbitUmarov 2020-07-13 23:26:09 +01:00
parent ba972b50ed
commit b2068fd39f
1 changed files with 22 additions and 19 deletions

View File

@ -911,28 +911,31 @@ namespace OpenSim.Region.CoreModules.Asset
gatherer.AddGathered(s.RegionInfo.RegionSettings.TerrainTexture4, (sbyte)AssetType.Texture); gatherer.AddGathered(s.RegionInfo.RegionSettings.TerrainTexture4, (sbyte)AssetType.Texture);
gatherer.AddGathered(s.RegionInfo.RegionSettings.TerrainImageID, (sbyte)AssetType.Texture); gatherer.AddGathered(s.RegionInfo.RegionSettings.TerrainImageID, (sbyte)AssetType.Texture);
s.ForEachSOG(delegate(SceneObjectGroup e) EntityBase[] entities = s.Entities.GetEntities();
for (int i = 0; i < entities.Length; ++i)
{ {
if(!m_timerRunning && !tryGetUncached || e.IsDeleted) if (!m_timerRunning && !tryGetUncached)
return; break;
gatherer.AddForInspection(e); EntityBase entity = entities[i];
gatherer.GatherAll(); if(entity is SceneObjectGroup)
{
SceneObjectGroup e = entity as SceneObjectGroup;
if(e.IsDeleted)
continue;
if (++cooldown > 200) gatherer.AddForInspection(e);
{ gatherer.GatherAll();
GC.Collect();
gatherer.AssetGetCount = 0; if (++cooldown > 200)
Thread.Sleep(50); {
cooldown = 0; Thread.Sleep(50);
cooldown = 0;
}
} }
else if(gatherer.AssetGetCount > 200) }
{ entities = null;
GC.Collect(); if (!m_timerRunning && !tryGetUncached)
gatherer.AssetGetCount = 0;
}
});
if(!m_timerRunning && !tryGetUncached)
break; break;
} }
@ -961,8 +964,8 @@ namespace OpenSim.Region.CoreModules.Asset
gatherer.GatheredUuids.Clear(); gatherer.GatheredUuids.Clear();
gatherer.FailedUUIDs.Clear(); gatherer.FailedUUIDs.Clear();
gatherer.UncertainAssetsUUIDs.Clear(); gatherer.UncertainAssetsUUIDs.Clear();
gatherer = null;
GC.Collect();
return count; return count;
} }