diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index dcb7d73461..dd9015bab7 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -143,6 +143,10 @@ namespace OpenSim.Framework.Communications.Cache
public void Clear()
{
m_log.Info("[ASSET CACHE]: Clearing Asset cache");
+
+ if (StatsManager.SimExtraStats != null)
+ StatsManager.SimExtraStats.ClearAssetCacheStatistics();
+
Initialize();
}
diff --git a/OpenSim/Framework/Statistics/BaseStatsCollector.cs b/OpenSim/Framework/Statistics/BaseStatsCollector.cs
index 225c551f0a..c888f4cd95 100644
--- a/OpenSim/Framework/Statistics/BaseStatsCollector.cs
+++ b/OpenSim/Framework/Statistics/BaseStatsCollector.cs
@@ -43,7 +43,7 @@ namespace OpenSim.Framework.Statistics
sb.Append(
string.Format(
"Allocated to OpenSim : {0} MB" + Environment.NewLine,
- Math.Round(GC.GetTotalMemory(true) / 1024.0 / 1024.0)));
+ Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0)));
return sb.ToString();
}
diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
index 7a74e72a63..0a20f3309d 100644
--- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
+++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
@@ -53,6 +53,11 @@ namespace OpenSim.Framework.Statistics
///
public long AbnormalClientThreadTerminations { get { return abnormalClientThreadTerminations; } }
+ ///
+ /// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the
+ /// notion of providing some flow statistics (which pull wouldn't give us). Though admittedly these
+ /// haven't yet been implemented... :)
+ ///
public long AssetsInCache { get { return assetsInCache; } }
public long TexturesInCache { get { return texturesInCache; } }
public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } }
@@ -100,6 +105,17 @@ namespace OpenSim.Framework.Statistics
textureCacheMemoryUsage += image.Data.Length;
}
}
+
+ ///
+ /// Signal that the asset cache can be cleared.
+ ///
+ public void ClearAssetCacheStatistics()
+ {
+ assetsInCache = 0;
+ assetCacheMemoryUsage = 0;
+ texturesInCache = 0;
+ textureCacheMemoryUsage = 0;
+ }
public void AddBlockedMissingTextureRequest()
{