From 5afc5fe343172c315adec97cd8348357a196d5d2 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 31 Aug 2016 09:15:08 +0100 Subject: Xengine: try to reduce memory pressure of scripts compile. Still ugly code, possible mistakes, but i need to share it before i loose it :) ) --- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine/XEngine.cs') diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index ecd0b69..f42b5ad 100755 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -1278,6 +1278,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine } } + // do not load a assembly on top of a lot of to release memory + // also yield a bit + GC.Collect(2); + ScriptInstance instance = null; lock (m_Scripts) { @@ -1501,11 +1505,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_PrimObjects[localID].Add(itemID); } - if (!m_Assemblies.ContainsKey(assetID)) - m_Assemblies[assetID] = assemblyPath; lock (m_AddingAssemblies) { + if (!m_Assemblies.ContainsKey(assetID)) + m_Assemblies[assetID] = assemblyPath; + m_AddingAssemblies[assemblyPath]--; } -- cgit v1.1