aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2016-12-02 13:51:30 +0000
committerUbitUmarov2016-12-02 13:51:30 +0000
commitb981ac42bc0f5ad305068bb2f6f2215010b96990 (patch)
tree99e1625f37c4d144e6076b9bfb9a443d7281cbec /OpenSim/Region
parentMerge branch 'master' into httptests (diff)
parent do a GC collect on last client exit (diff)
downloadopensim-SC-b981ac42bc0f5ad305068bb2f6f2215010b96990.zip
opensim-SC-b981ac42bc0f5ad305068bb2f6f2215010b96990.tar.gz
opensim-SC-b981ac42bc0f5ad305068bb2f6f2215010b96990.tar.bz2
opensim-SC-b981ac42bc0f5ad305068bb2f6f2215010b96990.tar.xz
Merge branch 'master' into httptests
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs8
-rw-r--r--OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs87
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs13
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs1
5 files changed, 92 insertions, 21 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 6cdf6f6..ce7ee98 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -619,11 +619,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
619 m_entityProps = new PriorityQueue(1); 619 m_entityProps = new PriorityQueue(1);
620 m_killRecord.Clear(); 620 m_killRecord.Clear();
621 GroupsInView.Clear(); 621 GroupsInView.Clear();
622// m_scene = null; can't do this unless checks are added everywhere due to workitems already in pools
623 622
624 //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false)); 623 if(m_scene.GetNumberOfClients() == 0)
625 //GC.Collect(); 624 GC.Collect();
626 //m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true));
627 } 625 }
628 626
629 public void Kick(string message) 627 public void Kick(string message)
@@ -2996,7 +2994,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2996 return; 2994 return;
2997 } 2995 }
2998 2996
2999 int WearableOut = 0;
3000 bool isWearable = false; 2997 bool isWearable = false;
3001 2998
3002 isWearable = ((AssetType) req.AssetInf.Type == 2999 isWearable = ((AssetType) req.AssetInf.Type ==
@@ -8563,7 +8560,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8563 // surrounding scene 8560 // surrounding scene
8564 if ((ImageType)block.Type == ImageType.Baked) 8561 if ((ImageType)block.Type == ImageType.Baked)
8565 args.Priority *= 2.0f; 8562 args.Priority *= 2.0f;
8566 int wearableout = 0;
8567 8563
8568 ImageManager.EnqueueReq(args); 8564 ImageManager.EnqueueReq(args);
8569 } 8565 }
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
index c4abc99..9413598 100644
--- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
+++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
@@ -62,6 +62,7 @@ namespace OpenSim.Region.CoreModules.Asset
62 MethodBase.GetCurrentMethod().DeclaringType); 62 MethodBase.GetCurrentMethod().DeclaringType);
63 63
64 private bool m_Enabled; 64 private bool m_Enabled;
65 private bool m_Running;
65 66
66 private const string m_ModuleName = "FlotsamAssetCache"; 67 private const string m_ModuleName = "FlotsamAssetCache";
67 private const string m_DefaultCacheDirectory = "./assetcache"; 68 private const string m_DefaultCacheDirectory = "./assetcache";
@@ -94,7 +95,7 @@ namespace OpenSim.Region.CoreModules.Asset
94 private const double m_DefaultFileExpiration = 48; 95 private const double m_DefaultFileExpiration = 48;
95 private TimeSpan m_MemoryExpiration = TimeSpan.FromHours(m_DefaultMemoryExpiration); 96 private TimeSpan m_MemoryExpiration = TimeSpan.FromHours(m_DefaultMemoryExpiration);
96 private TimeSpan m_FileExpiration = TimeSpan.FromHours(m_DefaultFileExpiration); 97 private TimeSpan m_FileExpiration = TimeSpan.FromHours(m_DefaultFileExpiration);
97 private TimeSpan m_FileExpirationCleanupTimer = TimeSpan.FromHours(0.166); 98 private TimeSpan m_FileExpirationCleanupTimer = TimeSpan.FromHours(1.0);
98 99
99 private static int m_CacheDirectoryTiers = 1; 100 private static int m_CacheDirectoryTiers = 1;
100 private static int m_CacheDirectoryTierLen = 3; 101 private static int m_CacheDirectoryTierLen = 3;
@@ -104,7 +105,8 @@ namespace OpenSim.Region.CoreModules.Asset
104 105
105 private IAssetService m_AssetService; 106 private IAssetService m_AssetService;
106 private List<Scene> m_Scenes = new List<Scene>(); 107 private List<Scene> m_Scenes = new List<Scene>();
107 108 private object timerLock = new object();
109
108 public FlotsamAssetCache() 110 public FlotsamAssetCache()
109 { 111 {
110 m_InvalidChars.AddRange(Path.GetInvalidPathChars()); 112 m_InvalidChars.AddRange(Path.GetInvalidPathChars());
@@ -170,14 +172,6 @@ namespace OpenSim.Region.CoreModules.Asset
170 172
171 m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Cache Directory {0}", m_CacheDirectory); 173 m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Cache Directory {0}", m_CacheDirectory);
172 174
173 if (m_FileCacheEnabled && (m_FileExpiration > TimeSpan.Zero) && (m_FileExpirationCleanupTimer > TimeSpan.Zero))
174 {
175 m_CacheCleanTimer = new System.Timers.Timer(m_FileExpirationCleanupTimer.TotalMilliseconds);
176 m_CacheCleanTimer.AutoReset = true;
177 m_CacheCleanTimer.Elapsed += CleanupExpiredFiles;
178 lock (m_CacheCleanTimer)
179 m_CacheCleanTimer.Start();
180 }
181 175
182 if (m_CacheDirectoryTiers < 1) 176 if (m_CacheDirectoryTiers < 1)
183 { 177 {
@@ -219,7 +213,6 @@ namespace OpenSim.Region.CoreModules.Asset
219 { 213 {
220 scene.RegisterModuleInterface<IImprovedAssetCache>(this); 214 scene.RegisterModuleInterface<IImprovedAssetCache>(this);
221 m_Scenes.Add(scene); 215 m_Scenes.Add(scene);
222
223 } 216 }
224 } 217 }
225 218
@@ -229,13 +222,39 @@ namespace OpenSim.Region.CoreModules.Asset
229 { 222 {
230 scene.UnregisterModuleInterface<IImprovedAssetCache>(this); 223 scene.UnregisterModuleInterface<IImprovedAssetCache>(this);
231 m_Scenes.Remove(scene); 224 m_Scenes.Remove(scene);
225 lock(timerLock)
226 {
227 if(m_Running && m_Scenes.Count <= 0)
228 {
229 m_Running = false;
230 m_CacheCleanTimer.Stop();
231 m_CacheCleanTimer.Close();
232 }
233 }
232 } 234 }
233 } 235 }
234 236
235 public void RegionLoaded(Scene scene) 237 public void RegionLoaded(Scene scene)
236 { 238 {
237 if (m_Enabled && m_AssetService == null) 239 if (m_Enabled)
238 m_AssetService = scene.RequestModuleInterface<IAssetService>(); 240 {
241 if(m_AssetService == null)
242 m_AssetService = scene.RequestModuleInterface<IAssetService>();
243 lock(timerLock)
244 {
245 if(!m_Running)
246 {
247 if (m_FileCacheEnabled && (m_FileExpiration > TimeSpan.Zero) && (m_FileExpirationCleanupTimer > TimeSpan.Zero))
248 {
249 m_CacheCleanTimer = new System.Timers.Timer(m_FileExpirationCleanupTimer.TotalMilliseconds);
250 m_CacheCleanTimer.AutoReset = false;
251 m_CacheCleanTimer.Elapsed += CleanupExpiredFiles;
252 m_CacheCleanTimer.Start();
253 m_Running = true;
254 }
255 }
256 }
257 }
239 } 258 }
240 259
241 //////////////////////////////////////////////////////////// 260 ////////////////////////////////////////////////////////////
@@ -542,6 +561,8 @@ namespace OpenSim.Region.CoreModules.Asset
542 if (m_LogLevel >= 2) 561 if (m_LogLevel >= 2)
543 m_log.DebugFormat("[FLOTSAM ASSET CACHE]: Checking for expired files older then {0}.", m_FileExpiration); 562 m_log.DebugFormat("[FLOTSAM ASSET CACHE]: Checking for expired files older then {0}.", m_FileExpiration);
544 563
564 if(!m_Running)
565 return;
545 // Purge all files last accessed prior to this point 566 // Purge all files last accessed prior to this point
546 DateTime purgeLine = DateTime.Now - m_FileExpiration; 567 DateTime purgeLine = DateTime.Now - m_FileExpiration;
547 568
@@ -554,6 +575,12 @@ namespace OpenSim.Region.CoreModules.Asset
554 { 575 {
555 CleanExpiredFiles(dir, purgeLine); 576 CleanExpiredFiles(dir, purgeLine);
556 } 577 }
578
579 lock(timerLock)
580 {
581 if(m_Running)
582 m_CacheCleanTimer.Start();
583 }
557 } 584 }
558 585
559 /// <summary> 586 /// <summary>
@@ -789,9 +816,15 @@ namespace OpenSim.Region.CoreModules.Asset
789 816
790 s.ForEachSOG(delegate(SceneObjectGroup e) 817 s.ForEachSOG(delegate(SceneObjectGroup e)
791 { 818 {
819 if(!m_Running && !storeUncached)
820 return;
821
792 gatherer.AddForInspection(e); 822 gatherer.AddForInspection(e);
793 gatherer.GatherAll(); 823 gatherer.GatherAll();
794 824
825 if(!m_Running && !storeUncached)
826 return;
827
795 foreach (UUID assetID in gatherer.GatheredUuids.Keys) 828 foreach (UUID assetID in gatherer.GatheredUuids.Keys)
796 { 829 {
797 if (!assetsFound.ContainsKey(assetID)) 830 if (!assetsFound.ContainsKey(assetID))
@@ -801,6 +834,7 @@ namespace OpenSim.Region.CoreModules.Asset
801 if (File.Exists(filename)) 834 if (File.Exists(filename))
802 { 835 {
803 UpdateFileLastAccessTime(filename); 836 UpdateFileLastAccessTime(filename);
837 assetsFound[assetID] = true;
804 } 838 }
805 else if (storeUncached) 839 else if (storeUncached)
806 { 840 {
@@ -820,7 +854,14 @@ namespace OpenSim.Region.CoreModules.Asset
820 } 854 }
821 855
822 gatherer.GatheredUuids.Clear(); 856 gatherer.GatheredUuids.Clear();
857 if(!m_Running && !storeUncached)
858 return;
859
860 if(!storeUncached)
861 Thread.Sleep(50);
823 }); 862 });
863 if(!m_Running && !storeUncached)
864 break;
824 } 865 }
825 866
826 return assetsFound.Count; 867 return assetsFound.Count;
@@ -982,7 +1023,27 @@ namespace OpenSim.Region.CoreModules.Asset
982 1023
983 WorkManager.RunInThread(delegate 1024 WorkManager.RunInThread(delegate
984 { 1025 {
1026 bool wasRunning= false;
1027 lock(timerLock)
1028 {
1029 if(m_Running)
1030 {
1031 m_CacheCleanTimer.Stop();
1032 m_Running = false;
1033 wasRunning = true;
1034 Thread.Sleep(100);
1035 }
1036 }
985 int assetReferenceTotal = TouchAllSceneAssets(true); 1037 int assetReferenceTotal = TouchAllSceneAssets(true);
1038 GC.Collect();
1039 lock(timerLock)
1040 {
1041 if(wasRunning)
1042 {
1043 m_CacheCleanTimer.Start();
1044 m_Running = true;
1045 }
1046 }
986 con.OutputFormat("Completed check with {0} assets.", assetReferenceTotal); 1047 con.OutputFormat("Completed check with {0} assets.", assetReferenceTotal);
987 }, null, "TouchAllSceneAssets"); 1048 }, null, "TouchAllSceneAssets");
988 1049
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
index b1234fe..d1fe3c7 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
@@ -188,7 +188,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
188 //m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions", mapName, regionInfos.Count); 188 //m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions", mapName, regionInfos.Count);
189 189
190 MapBlockData data; 190 MapBlockData data;
191 if (regionInfos.Count > 0) 191 if (regionInfos != null && regionInfos.Count > 0)
192 { 192 {
193 foreach (GridRegion info in regionInfos) 193 foreach (GridRegion info in regionInfos)
194 { 194 {
@@ -205,7 +205,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
205 } 205 }
206 206
207 // final block, closing the search result 207 // final block, closing the search result
208 AddFinalBlock(blocks,mapNameOrig); 208 AddFinalBlock(blocks,mapNameOrig);
209 209
210 // flags are agent flags sent from the viewer. 210 // flags are agent flags sent from the viewer.
211 // they have different values depending on different viewers, apparently 211 // they have different values depending on different viewers, apparently
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 80bb461..9c8d40a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -13792,6 +13792,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
13792 case ScriptBaseClass.OBJECT_GROUP_TAG: 13792 case ScriptBaseClass.OBJECT_GROUP_TAG:
13793 ret.Add(new LSL_String(av.Grouptitle)); 13793 ret.Add(new LSL_String(av.Grouptitle));
13794 break; 13794 break;
13795 case ScriptBaseClass.OBJECT_TEMP_ATTACHED:
13796 ret.Add(new LSL_Integer(0));
13797 break;
13795 default: 13798 default:
13796 // Invalid or unhandled constant. 13799 // Invalid or unhandled constant.
13797 ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL)); 13800 ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL));
@@ -13984,6 +13987,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
13984 case ScriptBaseClass.OBJECT_GROUP_TAG: 13987 case ScriptBaseClass.OBJECT_GROUP_TAG:
13985 ret.Add(new LSL_String(String.Empty)); 13988 ret.Add(new LSL_String(String.Empty));
13986 break; 13989 break;
13990 case ScriptBaseClass.OBJECT_TEMP_ATTACHED:
13991 if (obj.ParentGroup.AttachmentPoint != 0 && obj.ParentGroup.FromItemID == UUID.Zero)
13992 {
13993 ret.Add(new LSL_Integer(1));
13994 }
13995 else
13996 {
13997 ret.Add(new LSL_Integer(0));
13998 }
13999 break;
13987 default: 14000 default:
13988 // Invalid or unhandled constant. 14001 // Invalid or unhandled constant.
13989 ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL)); 14002 ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL));
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 17173a2..48afcc0 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -641,6 +641,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
641 public const int OBJECT_PRIM_COUNT = 30; 641 public const int OBJECT_PRIM_COUNT = 30;
642 public const int OBJECT_TOTAL_INVENTORY_COUNT = 31; 642 public const int OBJECT_TOTAL_INVENTORY_COUNT = 31;
643 public const int OBJECT_GROUP_TAG = 33; 643 public const int OBJECT_GROUP_TAG = 33;
644 public const int OBJECT_TEMP_ATTACHED = 34;
644 645
645 // Pathfinding types 646 // Pathfinding types
646 public const int OPT_OTHER = -1; 647 public const int OPT_OTHER = -1;