GC.GetTotalMemory(true) was blocking.

We now support individual scripts on individual prims. Do the script dance... \o/ \o\ /o/ \o/ .o.
afrisby
Tedd Hansen 2007-08-22 19:33:10 +00:00
parent 0eadb7591e
commit 4beef91d00
6 changed files with 19 additions and 14 deletions

View File

@ -58,6 +58,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
/// <returns>Free AppDomain</returns> /// <returns>Free AppDomain</returns>
private AppDomainStructure GetFreeAppDomain() private AppDomainStructure GetFreeAppDomain()
{ {
Console.WriteLine("Finding free AppDomain");
FreeAppDomains(); // Outsite lock, has its own GetLock FreeAppDomains(); // Outsite lock, has its own GetLock
lock (GetLock) lock (GetLock)
{ {
@ -141,8 +142,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
// Find next available AppDomain to put it in // Find next available AppDomain to put it in
AppDomainStructure FreeAppDomain = GetFreeAppDomain(); AppDomainStructure FreeAppDomain = GetFreeAppDomain();
if (FreeAppDomain == null) Console.WriteLine("FreeAppDomain == null"); //if (FreeAppDomain == null) Console.WriteLine("FreeAppDomain == null");
if (FreeAppDomain.CurrentAppDomain == null) Console.WriteLine("FreeAppDomain.CurrentAppDomain == null"); //if (FreeAppDomain.CurrentAppDomain == null) Console.WriteLine("FreeAppDomain.CurrentAppDomain == null");
Console.WriteLine("Loading into AppDomain: " + FileName);
LSL_BaseClass mbrt = (LSL_BaseClass)FreeAppDomain.CurrentAppDomain.CreateInstanceFromAndUnwrap(FileName, "SecondLife.Script"); LSL_BaseClass mbrt = (LSL_BaseClass)FreeAppDomain.CurrentAppDomain.CreateInstanceFromAndUnwrap(FileName, "SecondLife.Script");
//Type mytype = mbrt.GetType(); //Type mytype = mbrt.GetType();
Console.WriteLine("ScriptEngine AppDomainManager: is proxy={0}", RemotingServices.IsTransparentProxy(mbrt)); Console.WriteLine("ScriptEngine AppDomainManager: is proxy={0}", RemotingServices.IsTransparentProxy(mbrt));

View File

@ -51,7 +51,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
// TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager // TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager
// Hook up a test event to our test form // Hook up a test event to our test form
//myScriptEngine.Log.Verbose("ScriptEngine", "EventManager Hooking up to server events"); myScriptEngine.Log.Verbose("ScriptEngine", "Hooking up to server events");
myScriptEngine.World.EventManager.OnObjectGrab += new OpenSim.Region.Environment.Scenes.EventManager.ObjectGrabDelegate(touch_start); myScriptEngine.World.EventManager.OnObjectGrab += new OpenSim.Region.Environment.Scenes.EventManager.ObjectGrabDelegate(touch_start);
myScriptEngine.World.EventManager.OnRezScript += new OpenSim.Region.Environment.Scenes.EventManager.NewRezScript(OnRezScript); myScriptEngine.World.EventManager.OnRezScript += new OpenSim.Region.Environment.Scenes.EventManager.NewRezScript(OnRezScript);
myScriptEngine.World.EventManager.OnRemoveScript += new OpenSim.Region.Environment.Scenes.EventManager.RemoveScript(OnRemoveScript); myScriptEngine.World.EventManager.OnRemoveScript += new OpenSim.Region.Environment.Scenes.EventManager.RemoveScript(OnRemoveScript);
@ -62,6 +62,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
{ {
// Add to queue for all scripts in ObjectID object // Add to queue for all scripts in ObjectID object
//myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Event: touch_start"); //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Event: touch_start");
Console.WriteLine("touch_start localID: " + localID);
myScriptEngine.myEventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] { (int)1 }); myScriptEngine.myEventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] { (int)1 });
} }
public void OnRezScript(uint localID, LLUUID itemID, string script) public void OnRezScript(uint localID, LLUUID itemID, string script)
@ -75,11 +76,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
// new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost() // new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost()
//); //);
Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " + script.Length); Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " + script.Length);
myScriptEngine.myScriptManager.StartScript( myScriptEngine.myScriptManager.StartScript(localID, itemID, script);
localID,
itemID,
script
);
} }
public void OnRemoveScript(uint localID, LLUUID itemID) public void OnRemoveScript(uint localID, LLUUID itemID)

View File

@ -241,7 +241,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
// Do we have any scripts in this object at all? If not, return // Do we have any scripts in this object at all? If not, return
if (myScriptEngine.myScriptManager.Scripts.ContainsKey(localID) == false) if (myScriptEngine.myScriptManager.Scripts.ContainsKey(localID) == false)
{
Console.WriteLine("Event \"" + FunctionName + "\" for localID: " + localID + ". No scripts found on this localID.");
return; return;
}
foreach (LLUUID itemID in myScriptEngine.myScriptManager.GetScriptKeys(localID)) foreach (LLUUID itemID in myScriptEngine.myScriptManager.GetScriptKeys(localID))
{ {

View File

@ -169,11 +169,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
//OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName); //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName);
//OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName, localID); //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName, localID);
long before;
before = GC.GetTotalMemory(true); //long before;
//before = GC.GetTotalMemory(true);
LSL_BaseClass CompiledScript = m_scriptEngine.myAppDomainManager.LoadScript(FileName); LSL_BaseClass CompiledScript = m_scriptEngine.myAppDomainManager.LoadScript(FileName);
Console.WriteLine("Script " + itemID + " occupies {0} bytes", GC.GetTotalMemory(true) - before); //Console.WriteLine("Script " + itemID + " occupies {0} bytes", GC.GetTotalMemory(true) - before);
before = GC.GetTotalMemory(true); //before = GC.GetTotalMemory(true);
//Script = m_scriptEngine.myAppDomainManager.LoadScript(FileName); //Script = m_scriptEngine.myAppDomainManager.LoadScript(FileName);
//Console.WriteLine("Script occupies {0} bytes", GC.GetTotalMemory(true) - before); //Console.WriteLine("Script occupies {0} bytes", GC.GetTotalMemory(true) - before);
//before = GC.GetTotalMemory(true); //before = GC.GetTotalMemory(true);

View File

@ -4,8 +4,8 @@ physics = basicphysics
; Prim Storage ; Prim Storage
; if you would like to use sqlite uncomment the following line (and ; if you would like to use sqlite uncomment the following line (and
; comment the NullStorage line) ; comment the NullStorage line)
; storage_plugin = "OpenSim.DataStore.MonoSqlite.dll" storage_plugin = "OpenSim.DataStore.MonoSqlite.dll"
storage_plugin = "OpenSim.DataStore.NullStorage.dll" ;storage_plugin = "OpenSim.DataStore.NullStorage.dll"
startup_console_commands_file = "startup_commands.txt" startup_console_commands_file = "startup_commands.txt"
serverside_object_permissions = false serverside_object_permissions = false

Binary file not shown.