From a4b64d48548a663a84bbbb357da37de6fe01c4bd Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 29 Oct 2012 22:53:06 +0000 Subject: [PATCH] Add "force gc" region console command which manually invokes garbage collection. For debugging purposes. --- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 11 +++++++++++ OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index aac9c45fb7..5b2d7dc6d8 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -192,8 +192,19 @@ namespace OpenSim.Framework.Servers "threads show", "Show thread status. Synonym for \"show threads\"", (string module, string[] args) => Notice(GetThreadsReport())); + + m_console.Commands.AddCommand("General", false, "force gc", + "force gc", + "Manually invoke runtime garbage collection. For debugging purposes", + HandleForceGc); } } + + private void HandleForceGc(string module, string[] args) + { + MainConsole.Instance.Output("Manually invoking runtime garbage collection"); + GC.Collect(); + } /// /// Should be overriden and referenced by descendents if they need to perform extra shutdown processing diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 77e7df971f..a8326632ba 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -74,8 +74,9 @@ namespace OpenSim.Region.Framework.Scenes { // ~ScenePresence() // { -// m_log.Debug("[SCENE PRESENCE] Destructor called"); +// m_log.DebugFormat("[SCENE PRESENCE]: Destructor called on {0}", Name); // } + private void TriggerScenePresenceUpdated() { if (m_scene != null)