From a50a8376d60e7ff4ab80b04d00e143ee79c4245c Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sat, 9 Feb 2008 01:37:53 +0000 Subject: * In the most basic situations, ClientView and ScenePresence no longer leak memory * However, I'm no longer sure they were even a big contributory factor (to this particular leak, there are other causes of other leaks). I need better measurement techniques * Removed most of my debugging gawp --- OpenSim/Region/ClientStack/ClientView.cs | 8 ++++---- OpenSim/Region/Environment/Modules/TextureDownloadModule.cs | 10 ++++++++-- .../Region/Environment/Modules/UserTextureDownloadService.cs | 4 ++-- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 8 ++++---- 4 files changed, 18 insertions(+), 12 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 6f25191..1717825 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -51,10 +51,10 @@ namespace OpenSim.Region.ClientStack /// public class ClientView : IClientAPI { - ~ClientView() - { - System.Console.WriteLine("[CLIENTVIEW]: Destructor called"); - } +// ~ClientView() +// { +// System.Console.WriteLine("[CLIENTVIEW]: Destructor called"); +// } private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); diff --git a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs index 7529111..4f877be 100644 --- a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs +++ b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs @@ -146,9 +146,12 @@ namespace OpenSim.Region.Environment.Modules public void ProcessTextureSenders() { + TextureSender sender = null; + while (true) { - TextureSender sender = m_queueSenders.Dequeue(); + sender = m_queueSenders.Dequeue(); + if (sender.Cancel) { TextureSent(sender); @@ -168,7 +171,10 @@ namespace OpenSim.Region.Environment.Modules } } - m_log.Info(String.Format("[TEXTURE DOWNLOAD] Texture sender queue size: {0}", m_queueSenders.Count())); + // Make sure that any sender we currently have can get garbage collected + sender = null; + + //m_log.Info(String.Format("[TEXTURE DOWNLOAD] Texture sender queue size: {0}", m_queueSenders.Count())); } } diff --git a/OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs index 08b6979..999f4a2 100644 --- a/OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs +++ b/OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs @@ -104,9 +104,9 @@ namespace OpenSim.Region.Environment.Modules EnqueueTextureSender(textureSender); } - m_log.Info(String.Format("[TEXTURE SENDER] Removing texture sender with uuid {0}", textureID)); + //m_log.Info(String.Format("[TEXTURE SENDER] Removing texture sender with uuid {0}", textureID)); m_textureSenders.Remove(textureID); - m_log.Info(String.Format("[TEXTURE SENDER] Current texture senders in dictionary: {0}", m_textureSenders.Count)); + //m_log.Info(String.Format("[TEXTURE SENDER] Current texture senders in dictionary: {0}", m_textureSenders.Count)); } else { diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 1b9e154..21710c0 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -39,10 +39,10 @@ namespace OpenSim.Region.Environment.Scenes { public class ScenePresence : EntityBase { - ~ScenePresence() - { - System.Console.WriteLine("[ScenePresence] Destructor called"); - } +// ~ScenePresence() +// { +// System.Console.WriteLine("[ScenePresence] Destructor called"); +// } private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); -- cgit v1.1