Memory leak ?

Jul 10, 2013 at 3:15 PM
Hi there,

When using mono, and this code in c#:

this.context = new ExpressionContext ();
    for (int i = 0; i < 1000005; i++) {
        var e = this.context.CompileDynamic ("112 = 249");

        Console.WriteLine (i + ":" + e.Evaluate ().ToString ());
        if (i > 20000) {
            Thread.Sleep (10000);
            i = 0;
        }
    }
will cause memory to go up and up.

this is a test piece of code, as simple as it can get. Wat can this be ?

Im planning on using the expression evaluator in a industrial process, that checks certain conditions over and over again in a while loop, performing specific actions. As it has to be embedded, it must not leak.

What can this be, and how can it be solved ?

Kind regards,