Add "gc collect" console command for debugging memleaks

avinationmerge
Melanie 2012-07-12 00:16:19 +02:00
parent d9b0b03aa3
commit c66367e619
1 changed files with 7 additions and 0 deletions

View File

@ -831,6 +831,8 @@ namespace OpenSim.Region.Framework.Scenes
StatsReporter = new SimStatsReporter(this); StatsReporter = new SimStatsReporter(this);
StatsReporter.OnSendStatsResult += SendSimStatsPackets; StatsReporter.OnSendStatsResult += SendSimStatsPackets;
StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
MainConsole.Instance.Commands.AddCommand("scene", false, "gc collect", "gc collect", "gc collect", "Cause the garbage collector to make a single pass", HandleGcCollect);
} }
/// <summary> /// <summary>
@ -5637,5 +5639,10 @@ Environment.Exit(1);
} }
} }
} }
private void HandleGcCollect(string module, string[] args)
{
GC.Collect();
}
} }
} }