Stop individually deleting objects at the end of each ObjectTortureTest.
We can now do this since the entire scene and all objects within it are now successfully gc'd at the end of these tests. This greatly improves the time taken to run each test (by reducing teardown time, not the time to actually do the test work that we're interested in). Slightly simplifies config read in Scene constructor to help facilitate this.0.7.4.1
parent
23aba007dd
commit
f3678d217f
|
@ -628,10 +628,10 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
#region Region Config
|
||||
|
||||
try
|
||||
// Region config overrides global config
|
||||
//
|
||||
if (m_config.Configs["Startup"] != null)
|
||||
{
|
||||
// Region config overrides global config
|
||||
//
|
||||
IConfig startupConfig = m_config.Configs["Startup"];
|
||||
|
||||
m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance);
|
||||
|
@ -721,40 +721,33 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain);
|
||||
m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning);
|
||||
}
|
||||
catch
|
||||
{
|
||||
m_log.Warn("[SCENE]: Failed to load StartupConfig");
|
||||
}
|
||||
|
||||
#endregion Region Config
|
||||
|
||||
#region Interest Management
|
||||
|
||||
if (m_config != null)
|
||||
IConfig interestConfig = m_config.Configs["InterestManagement"];
|
||||
if (interestConfig != null)
|
||||
{
|
||||
IConfig interestConfig = m_config.Configs["InterestManagement"];
|
||||
if (interestConfig != null)
|
||||
string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
|
||||
|
||||
try
|
||||
{
|
||||
string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
|
||||
|
||||
try
|
||||
{
|
||||
m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
|
||||
m_priorityScheme = UpdatePrioritizationSchemes.Time;
|
||||
}
|
||||
|
||||
m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true);
|
||||
m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0);
|
||||
m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0);
|
||||
m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0);
|
||||
m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
|
||||
m_priorityScheme = UpdatePrioritizationSchemes.Time;
|
||||
}
|
||||
|
||||
m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true);
|
||||
m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0);
|
||||
m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0);
|
||||
m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0);
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme);
|
||||
m_log.DebugFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme);
|
||||
|
||||
#endregion Interest Management
|
||||
|
||||
|
|
|
@ -75,6 +75,10 @@ namespace OpenSim.Tests.Torture
|
|||
[TestFixtureTearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
scene.Close();
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
|
||||
// We must set this back afterwards, otherwise later tests will fail since they're expecting multiple
|
||||
// threads. Possibly, later tests should be rewritten not to worry about such things.
|
||||
Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
|
||||
|
|
|
@ -156,11 +156,6 @@ namespace OpenSim.Tests.Torture
|
|||
// objects will be clean up by the garbage collector before the next stress test is run.
|
||||
scene.Update();
|
||||
|
||||
// Currently, we need to do this in order to garbage collect the scene objects ready for the next test run.
|
||||
// However, what we really need to do is find out why the entire scene is not garbage collected in
|
||||
// teardown.
|
||||
scene.DeleteAllSceneObjects();
|
||||
|
||||
Console.WriteLine(
|
||||
"Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)",
|
||||
Math.Round(elapsed.TotalMilliseconds),
|
||||
|
@ -170,7 +165,8 @@ namespace OpenSim.Tests.Torture
|
|||
objectsToAdd,
|
||||
primsInEachObject);
|
||||
|
||||
scene = null;
|
||||
scene.Close();
|
||||
// scene = null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -91,6 +91,14 @@ namespace OpenSim.Tests.Torture
|
|||
m_scene.StartScripts();
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
m_scene.Close();
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCompileAndStart100Scripts()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue