From c66367e6194f22da86a3bf972ec107212e732d80 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 12 Jul 2012 00:16:19 +0200
Subject: Add "gc collect" console command for debugging memleaks

---
 OpenSim/Region/Framework/Scenes/Scene.cs | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 6a120c1..48aca98 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -831,6 +831,8 @@ namespace OpenSim.Region.Framework.Scenes
             StatsReporter = new SimStatsReporter(this);
             StatsReporter.OnSendStatsResult += SendSimStatsPackets;
             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>
@@ -5637,5 +5639,10 @@ Environment.Exit(1);
                 }
             }
         }
+
+        private void HandleGcCollect(string module, string[] args)
+        {
+            GC.Collect();
+        }
     }
 }
-- 
cgit v1.1