Hi,

 

I am using evaluateString method that in org.mozilla._javascript_.Context

I am running the below code every 1 minute and I see that I have memory leak.

When I disable the call to evaluateString and run from start there is no memory leak.

 

My code:

 

public class MyCode implements WrapHandler, ErrorReporter

{

public Object eval(String script, String url, int line)

        {

                Context cx = Context.enter();

                cx.setWrapHandler(this);

                cx.setErrorReporter(this);

 

                try {

                                        Object result = callEvaluateString (cx, wnd, script, url, line);

                        return result;

                }

                finally {

Context.exit();

}             

        }

 

private Object callEvaluateString

                ( final Context cx, final Scriptable scope,

                 final String script, final String url, final int line)

        {

                Object result = null;

                try {

 

                        result = cx.evaluateString

                              (scope, script, url, line, secureObj);

 

                         finish = true;

                }

                catch (_javascript_Exception ex) {

                        return ex;

                }

                return result;

        }

}

Thanks & Best regards
Harel


Walla! Mail - Get your free unlimited mail today
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to