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.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)
return;
if (!m_timerRunning && !tryGetUncached)
break;
EntityBase entity = entities[i];
if(entity is SceneObjectGroup)
{
SceneObjectGroup e = entity as SceneObjectGroup;
if(e.IsDeleted)
continue;
gatherer.AddForInspection(e);
gatherer.GatherAll();
if (++cooldown > 200)
{
GC.Collect();
gatherer.AssetGetCount = 0;
Thread.Sleep(50);
cooldown = 0;
}
else if(gatherer.AssetGetCount > 200)
{
GC.Collect();
gatherer.AssetGetCount = 0;
}
});
if(!m_timerRunning && !tryGetUncached)
}
entities = null;
if (!m_timerRunning && !tryGetUncached)
break;
}
@ -961,8 +964,8 @@ namespace OpenSim.Region.CoreModules.Asset
gatherer.GatheredUuids.Clear();
gatherer.FailedUUIDs.Clear();
gatherer.UncertainAssetsUUIDs.Clear();
gatherer = null;
GC.Collect();
return count;
}