diff options
author | UbitUmarov | 2016-11-03 12:58:43 +0000 |
---|---|---|
committer | UbitUmarov | 2016-11-03 12:58:43 +0000 |
commit | 73b20c2ca25e5ee6f1b6673ef764c4da40625ec3 (patch) | |
tree | 8a0bbaa62ef0495a96a19004d5b8c16c801affc8 | |
parent | ubOde: if a mesh does not contain data for shape type PRIM, dont collide as c... (diff) | |
download | opensim-SC-73b20c2ca25e5ee6f1b6673ef764c4da40625ec3.zip opensim-SC-73b20c2ca25e5ee6f1b6673ef764c4da40625ec3.tar.gz opensim-SC-73b20c2ca25e5ee6f1b6673ef764c4da40625ec3.tar.bz2 opensim-SC-73b20c2ca25e5ee6f1b6673ef764c4da40625ec3.tar.xz |
XEngine: make calls to gc.collect on region startup scripts loading a configurable option, since it is very slow operation
-rwxr-xr-x | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 12 | ||||
-rw-r--r-- | bin/OpenSim.ini.example | 7 | ||||
-rw-r--r-- | bin/OpenSimDefaults.ini | 25 |
3 files changed, 30 insertions, 14 deletions
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 | |||
110 | private int m_ScriptFailCount; // Number of script fails since compile queue was last empty | 110 | private int m_ScriptFailCount; // Number of script fails since compile queue was last empty |
111 | private string m_ScriptErrorMessage; | 111 | private string m_ScriptErrorMessage; |
112 | private bool m_AppDomainLoading; | 112 | private bool m_AppDomainLoading; |
113 | private bool m_CompactMemOnLoad; | ||
113 | private Dictionary<UUID,ArrayList> m_ScriptErrors = | 114 | private Dictionary<UUID,ArrayList> m_ScriptErrors = |
114 | new Dictionary<UUID,ArrayList>(); | 115 | new Dictionary<UUID,ArrayList>(); |
115 | 116 | ||
@@ -301,8 +302,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
301 | m_MaxScriptQueue = m_ScriptConfig.GetInt("MaxScriptEventQueue",300); | 302 | m_MaxScriptQueue = m_ScriptConfig.GetInt("MaxScriptEventQueue",300); |
302 | m_StackSize = m_ScriptConfig.GetInt("ThreadStackSize", 262144); | 303 | m_StackSize = m_ScriptConfig.GetInt("ThreadStackSize", 262144); |
303 | m_SleepTime = m_ScriptConfig.GetInt("MaintenanceInterval", 10) * 1000; | 304 | m_SleepTime = m_ScriptConfig.GetInt("MaintenanceInterval", 10) * 1000; |
304 | m_AppDomainLoading = m_ScriptConfig.GetBoolean("AppDomainLoading", true); | 305 | m_AppDomainLoading = m_ScriptConfig.GetBoolean("AppDomainLoading", false); |
305 | 306 | m_CompactMemOnLoad = m_ScriptConfig.GetBoolean("CompactMemOnLoad", false); | |
306 | m_EventLimit = m_ScriptConfig.GetInt("EventLimit", 30); | 307 | m_EventLimit = m_ScriptConfig.GetInt("EventLimit", 30); |
307 | m_KillTimedOutScripts = m_ScriptConfig.GetBoolean("KillTimedOutScripts", false); | 308 | m_KillTimedOutScripts = m_ScriptConfig.GetBoolean("KillTimedOutScripts", false); |
308 | m_SaveTime = m_ScriptConfig.GetInt("SaveInterval", 120) * 1000; | 309 | m_SaveTime = m_ScriptConfig.GetInt("SaveInterval", 120) * 1000; |
@@ -1278,10 +1279,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1278 | } | 1279 | } |
1279 | } | 1280 | } |
1280 | 1281 | ||
1281 | // do not load a assembly on top of a lot of to release memory | 1282 | // optionaly do not load a assembly on top of a lot of to release memory |
1282 | // also yield a bit | 1283 | // only if logins disable since causes a lot of rubber banding |
1283 | // only if logins disable since causes a lot of rubber banding | 1284 | if(m_CompactMemOnLoad && !m_Scene.LoginsEnabled) |
1284 | if(!m_Scene.LoginsEnabled) | ||
1285 | GC.Collect(2); | 1285 | GC.Collect(2); |
1286 | 1286 | ||
1287 | ScriptInstance instance = null; | 1287 | ScriptInstance instance = null; |
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 4b83751..dce32bf 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example | |||
@@ -925,6 +925,13 @@ | |||
925 | ;; by scripts have changed. | 925 | ;; by scripts have changed. |
926 | ; DeleteScriptsOnStartup = true | 926 | ; DeleteScriptsOnStartup = true |
927 | 927 | ||
928 | ;# {CompactMemOnLoad} {} {compacts memory on each script load at startup?} {true false} false | ||
929 | ;; forces calls to memory garbage collector before loading each script DLL during region startup. | ||
930 | ;; Peek memory usage is reduced and region starts with a more compacted memory allocation. | ||
931 | ;; But this costs a lot of time, so region load will take a lot longer. | ||
932 | ;; it is more usefull if there are no previously compiled scripts DLLs (as with DeleteScriptsOnStartup = true) | ||
933 | ;CompactMemOnLoad = false | ||
934 | |||
928 | ;# {DefaultCompileLanguage} {Enabled:true} {Default script language?} {lsl vb cs} lsl | 935 | ;# {DefaultCompileLanguage} {Enabled:true} {Default script language?} {lsl vb cs} lsl |
929 | ;; Default language for scripts | 936 | ;; Default language for scripts |
930 | ; DefaultCompileLanguage = "lsl" | 937 | ; DefaultCompileLanguage = "lsl" |
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index e846e73..cb320a2 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini | |||
@@ -1696,14 +1696,23 @@ | |||
1696 | ; this may only be a problem if regions stay alive for a long time with lots of scripts added or edited. | 1696 | ; this may only be a problem if regions stay alive for a long time with lots of scripts added or edited. |
1697 | ; at this time some mono versions seem to have problems with the true option | 1697 | ; at this time some mono versions seem to have problems with the true option |
1698 | ; so default is now false until a fix is found | 1698 | ; so default is now false until a fix is found |
1699 | AppDomainLoading = false | 1699 | ; AppDomainLoading = false |
1700 | 1700 | ||
1701 | ; Controls whether previously compiled scripts DLLs are deleted on sim restart. If you set this to false | 1701 | ; Controls whether previously compiled scripts DLLs are deleted on sim restart. |
1702 | ; then startup will be considerably faster since scripts won't need to be recompiled. However, then it becomes your responsibility to delete the | 1702 | ; If you set this to false then startup will be considerably faster since scripts won't need to be recompiled. |
1703 | ; compiled scripts if you're recompiling OpenSim from source code and internal interfaces used | 1703 | ; It should be true on first run after updating opensim binary version |
1704 | ; by scripts have changed. | 1704 | ; after first run you can change to false. |
1705 | ; DeleteScriptsOnStartup = false | 1705 | ; You can also set it to false and delete the script DLLs by hand |
1706 | 1706 | ; This does not delete cached scripts state. | |
1707 | ; DeleteScriptsOnStartup = true | ||
1708 | |||
1709 | ; CompactMemOnLoad forces calls to memory garbage collector before loading each script binary | ||
1710 | ; forces calls to memory garbage collector before loading each script DLL during region startup. | ||
1711 | ; Peek memory usage is reduced and region starts with a more compacted memory allocation. | ||
1712 | ; But this costs a lot of time, so region load will take a lot longer. | ||
1713 | ; it is more usefull if there are no previously compiled scripts DLLs (or DeleteScriptsOnStartup = true) | ||
1714 | ; CompactMemOnLoad = false | ||
1715 | |||
1707 | ; Controls whether scripts are stopped by aborting their threads externally (abort) | 1716 | ; Controls whether scripts are stopped by aborting their threads externally (abort) |
1708 | ; or by co-operative checks inserted by OpenSimulator into compiled script (co-op). | 1717 | ; or by co-operative checks inserted by OpenSimulator into compiled script (co-op). |
1709 | ; co-op will be more stable as aborting threads can cause instability. | 1718 | ; co-op will be more stable as aborting threads can cause instability. |