On Dec 7, 11:51 am, Keith <[email protected]> wrote:
> I am using Rhino to compile and run .js files from within a servlet.
> When I hit the servlet from a browser several times, I see each
> execution creates one or may be more instances of
> java.lang.ref.Finalizer and never releases it.
>
> When I took a heap dump and analyzed it with Eclipse Memory Analyzer I
> see each java.lang.ref.Finalizer refers to another instance of
> Finalizer like a chain:
>
> java.lang.ref.Finalizer ->  java.lang.ref.Finalizer  - >
> java.lang.ref.Finalizer  -> java.lang.ref.Finalizer -> and so on.
>
> Also, each java.lang.ref.Finalizer  would also refer to a
> FileInputStream with the file descriptor value of -1.
>
> Inside the Servlet I am not compiling the .js files, I run it with
> setOptimizationLevel(-1) which only interprets the files. Also, all
> open files are clearly close inside of the finally clause.
>
> I wonder if there is a common flaw of some sort that would cause this
> java.lang.ref.Finalizer chain in the heap.

In the first line I mentioned I compile and run and later I mentioned
I do not compile but run only in interpret.
What I meant was , I do a
                        c.setOptimizationLevel(-1);
                        Script script = c.compileReader(fileReader, somename, 
1, null);
                        script.exec(c, scope);
where c is the Context object.


I am not sure what is wrong here!
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to