From 73b20c2ca25e5ee6f1b6673ef764c4da40625ec3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 3 Nov 2016 12:58:43 +0000 Subject: XEngine: make calls to gc.collect on region startup scripts loading a configurable option, since it is very slow operation --- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 3038915..e12f850 100755 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -110,6 +110,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine private int m_ScriptFailCount; // Number of script fails since compile queue was last empty private string m_ScriptErrorMessage; private bool m_AppDomainLoading; + private bool m_CompactMemOnLoad; private Dictionary m_ScriptErrors = new Dictionary(); @@ -301,8 +302,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_MaxScriptQueue = m_ScriptConfig.GetInt("MaxScriptEventQueue",300); m_StackSize = m_ScriptConfig.GetInt("ThreadStackSize", 262144); m_SleepTime = m_ScriptConfig.GetInt("MaintenanceInterval", 10) * 1000; - m_AppDomainLoading = m_ScriptConfig.GetBoolean("AppDomainLoading", true); - + m_AppDomainLoading = m_ScriptConfig.GetBoolean("AppDomainLoading", false); + m_CompactMemOnLoad = m_ScriptConfig.GetBoolean("CompactMemOnLoad", false); m_EventLimit = m_ScriptConfig.GetInt("EventLimit", 30); m_KillTimedOutScripts = m_ScriptConfig.GetBoolean("KillTimedOutScripts", false); m_SaveTime = m_ScriptConfig.GetInt("SaveInterval", 120) * 1000; @@ -1278,10 +1279,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine } } - // do not load a assembly on top of a lot of to release memory - // also yield a bit - // only if logins disable since causes a lot of rubber banding - if(!m_Scene.LoginsEnabled) + // optionaly do not load a assembly on top of a lot of to release memory + // only if logins disable since causes a lot of rubber banding + if(m_CompactMemOnLoad && !m_Scene.LoginsEnabled) GC.Collect(2); ScriptInstance instance = null; -- cgit v1.1