flotsam: slow it a lot more, make some debug log visible

master
UbitUmarov 2020-07-28 04:26:13 +01:00
parent d52b794828
commit bd2476c61e
1 changed files with 11 additions and 8 deletions

View File

@ -679,7 +679,7 @@ namespace OpenSim.Region.CoreModules.Asset
private void CleanupExpiredFiles(object source, ElapsedEventArgs e) private void CleanupExpiredFiles(object source, ElapsedEventArgs e)
{ {
long heap = 0; long heap = 0;
if (m_LogLevel >= 2) //if (m_LogLevel >= 2)
{ {
m_log.DebugFormat("[FLOTSAM ASSET CACHE]: Start automatic Check for expired files older then {0}.", m_FileExpiration); m_log.DebugFormat("[FLOTSAM ASSET CACHE]: Start automatic Check for expired files older then {0}.", m_FileExpiration);
heap = GC.GetTotalMemory(false); heap = GC.GetTotalMemory(false);
@ -697,9 +697,11 @@ namespace OpenSim.Region.CoreModules.Asset
// An asset cache may contain local non-temporary assets that are not in the asset service. Therefore, // An asset cache may contain local non-temporary assets that are not in the asset service. Therefore,
// before cleaning up expired files we must scan the objects in the scene to make sure that we retain // before cleaning up expired files we must scan the objects in the scene to make sure that we retain
// such local assets if they have not been recently accessed. // such local assets if they have not been recently accessed.
m_log.Info("[FLOTSAM ASSET CACHE] start touch files of assets in use");
TouchAllSceneAssets(false); TouchAllSceneAssets(false);
int cooldown = 0; int cooldown = 0;
if(Directory.Exists(m_CacheDirectory)) m_log.Info("[FLOTSAM ASSET CACHE] asset files expire");
if (Directory.Exists(m_CacheDirectory))
{ {
foreach (string dir in Directory.GetDirectories(m_CacheDirectory)) foreach (string dir in Directory.GetDirectories(m_CacheDirectory))
CleanExpiredFiles(dir, purgeLine, ref cooldown); CleanExpiredFiles(dir, purgeLine, ref cooldown);
@ -711,7 +713,7 @@ namespace OpenSim.Region.CoreModules.Asset
m_CacheCleanTimer.Start(); m_CacheCleanTimer.Start();
m_cleanupRunning = false; m_cleanupRunning = false;
} }
if (m_LogLevel >= 2) //if (m_LogLevel >= 2)
{ {
heap = GC.GetTotalMemory(false) - heap; heap = GC.GetTotalMemory(false) - heap;
double fheap = Math.Round((double)(heap / (1024 * 1024)),3); double fheap = Math.Round((double)(heap / (1024 * 1024)),3);
@ -976,12 +978,13 @@ namespace OpenSim.Region.CoreModules.Asset
continue; continue;
gatherer.AddForInspection(e); gatherer.AddForInspection(e);
gatherer.GatherAll(); while(gatherer.GatherNext())
if (++cooldown > 100)
{ {
Thread.Sleep(50); if (++cooldown > 100)
cooldown = 0; {
Thread.Sleep(50);
cooldown = 0;
}
} }
} }
} }