diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 0ee21aca2b..852e1b1a6e 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -28,6 +28,7 @@
using System;
using System.IO;
using System.Reflection;
+using System.Timers;
using log4net;
using OpenSim.Framework.Console;
using OpenSim.Framework.Statistics;
@@ -41,6 +42,12 @@ namespace OpenSim.Framework.Servers
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ ///
+ /// This will control a periodic log printout of the current 'show stats' (if they are active) for this
+ /// server.
+ ///
+ private Timer m_periodicLogStatsTimer = new Timer(60 * 60 * 1000);
+
protected ConsoleBase m_console;
///
@@ -68,6 +75,20 @@ namespace OpenSim.Framework.Servers
{
m_startuptime = DateTime.Now;
m_version = VersionInfo.Version;
+
+ m_periodicLogStatsTimer.Elapsed += new ElapsedEventHandler(LogStats);
+ m_periodicLogStatsTimer.Enabled = true;
+ }
+
+ ///
+ /// Print statistics to the logfile, if they are active
+ ///
+ protected void LogStats(object source, ElapsedEventArgs e)
+ {
+ if (m_stats != null)
+ {
+ m_log.Info(m_stats.Report());
+ }
}
///
diff --git a/OpenSim/Framework/Statistics/BaseStatsCollector.cs b/OpenSim/Framework/Statistics/BaseStatsCollector.cs
index c888f4cd95..225c551f0a 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(false) / 1024.0 / 1024.0)));
+ Math.Round(GC.GetTotalMemory(true) / 1024.0 / 1024.0)));
return sb.ToString();
}