I'm not sure when this crept back into the interface but mIRC isn't freeing memory again:
1. Open your favorite program-memory-usage monitor(taskmanager)
2. Load the following script into a fresh mIRC
3. Enter: /example
alias example {
var %x = $iif($1 isnum, $1, 5000)
var %com = example
var %js = (function(){return{"test":Array(4000).join("a")}})()
var %err
echo -a Processing %x iterations
.comopen example MSScriptControl.scriptControl
if (!$com(example) || $comerr) {
%err = Failed to create MSScriptControl.ScriptControl
}
elseif (!$com(example, language, 4, bstr, jscript) || $comerr) {
%err = Failed to set language to jscript
}
else {
while (%x) {
dec %x
if (!$com(example, Eval, 1, bstr, %js) || $comerr) {
%err = Failed to execute jscript
}
}
}
echo -a Done!
:error
if ($com(example)) {
.comclose example
}
if (%err) {
echo -s %err
}
}
For comparison, here is the same script to be ran under cscript.exe. You will notice after the initial memory spike of creating the MSScriptControl then the memory fluctuates but doesn't have a steady increase:
WScript.StdOut.write("How many times to iterate?");
WScript.StdIn.Read(0);
var x = Number(WScript.StdIn.readLine());
var js = '(function(){return{"test":Array(4000).join("a")}})()'
if (isNaN(x)) {
x = 5000;
}
var leakTest, leakTestRes;
// create an instance of the ScriptControl and set language
leakTest = new ActiveXObject('MSScriptControl.ScriptControl');
leakTest.language = 'jscript';
while (x > 0) {
x--;
leakTestRes = leakTest.eval(js);
}
// remove reference.
leakTest = null;
WScript.StdOut.Write("Press enter to exit...");
WScript.StdIn.Read(0);
WScript.StdIn.ReadLine();
Echo info - this issue has been reported to me as early as mIRC v7.48 (the release that supposedly fixed it

)
10 7.51 1561 ad5337d2a735eec9e6ffc9ffa5b097d3 ok 1 1 0 0