Is there a solution to avoid memory leak in a simple expression evaluation like this ?
inter.SetVariable("tick", tick++);
if (inter.Eval<bool>("(tick%2)==1"))
{
odd++;
if ((odd % 100) == 0)
System.GC.Collect();
}
else
even++;
I'm running this code periodically in a WinForm application on a Linux machine with Mono (5.0.1.1) and the memory usage continuously increase. Tested on Windows the Process.WorkingSet64 was increasing with a lower rate than Linux. The GC.GetTotalMemory is always stable.