From 4bf47fa592fd60716ffd6b34d418c241709c4744 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 30 Sep 2009 10:59:10 -0700 Subject: This releases the texture assets from LLImageManager cache, and re-requests them later if the client asks for them again. Needs more testing in texture-rich sims. --- .../Region/ClientStack/LindenUDP/LLImageManager.cs | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs index 295a5e6..b039049 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs @@ -257,6 +257,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP J2KImage imagereq = m_imagestore[m_priorities.Values[x]]; if (imagereq.m_decoded == true && !imagereq.m_completedSendAtCurrentDiscardLevel) { + // we need to test this here now that we are dropping assets + if (!imagereq.m_hasasset) + { + m_log.WarnFormat("[LLIMAGE MANAGER]: Re-requesting the image asset {0}", imagereq.m_requestedUUID); + imagereq.RunUpdate(); + continue; + } + numCollected++; //SendPackets will send up to ten packets per cycle if (imagereq.SendPackets(m_client, maxpack)) @@ -264,8 +272,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP //Send complete if (!imagereq.m_completedSendAtCurrentDiscardLevel) { - imagereq.m_completedSendAtCurrentDiscardLevel = true; + // I think this field imagereq.m_completedSendAtCurrentDiscardLevel + // is completely redundant + //imagereq.m_completedSendAtCurrentDiscardLevel = true; + Interlocked.Decrement(ref m_outstandingtextures); + + // First and foremost, drop the reference to the asset + // so that the asset doesn't stay in memory forever. + // We'll Get it again from the asset service (usually cache) + // if/when the client requests it again. + // In order not to mess much with the current implementation + // of this management code, we drop only the asset reference + // but keep the image request itself. + imagereq.DropAsset(); + //Re-assign priority to bottom //Remove the old priority m_priorities.Remove(imagereq.m_designatedPriorityKey); -- cgit v1.1