So we wrote some code that increases the saving time from a handful of seconds to one minute after it's run:
(scroll down, the interesting part is at the end)
var rand;
var ar = new Array();
// initialize string randomly
for (var k = 0; k <= 20; k = k + 1)
{
rand = Random(1,3);
switch(rand)
{
case 1:
ar[k] = "G/500";
break;
case 2:
ar[k] = "B/1000";
break;
case 3:
ar[k] = "R/100";
break;
}
}
// Change i to change the save time
// i = 500 --> 1mn
// i = 1000 --> 3mn
for (var i = 1; i <= 500; i = i + 1)
{
for (var j = 0; j < ar.Length; j = j + 1)
{
var ch = new String(ar[j]);
var tab = ch.Split("/");
}
}
Game.Msg("GO SAVE!!!");
Game.LOG("FINISH!!");
If we comment out the lines with new String and Split the saving time does not change.
We're going to work around these functions but I hope this can help you track these leaks. Oh and we did the same kinda thing with dynamic entities and it didn't change a thing.
Cheers,
Olivier