Scheduler Memory Leak??

We seem to be hitting an OutOfMemory error on the production server.

We’re running Servoy 6.0.7 on Linux with a MySQL database.

We also have a scheduler batch processor that runs every 30 seconds (to generate a PDF based on a user request). We didn’t seem to have the issue (at least this obviously) before adding the batch. Is there a memory leak in the scheduler plug-in?

We’re also getting a second error (LOTS of them in the log): “Rhino runtime detected object 2E21AE4D-6548-43AE-8F7C-36187913FAD2 of class com.servoy.j2db.util.UUID where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call.”

Where is this type of error generated? Is it in our code - or internal to Servoy or ??

Thanks for any help you can provide on this!

OutOfMemory error:

Sep 17, 2012 9:15:27 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 831 ms
Exception in thread "pool-3-thread-1" java.lang.OutOfMemoryError: Java heap space
        at java.awt.image.PixelGrabber.setDimensions(PixelGrabber.java:360)
        at sun.awt.image.OffScreenImageSource.produce(OffScreenImageSource.java:167)
        at sun.awt.image.OffScreenImageSource.addConsumer(OffScreenImageSource.java:48)
        at sun.awt.image.OffScreenImageSource.startProduction(OffScreenImageSource.java:62)
        at java.awt.image.PixelGrabber.grabPixels(PixelGrabber.java:242)
        at java.awt.image.PixelGrabber.grabPixels(PixelGrabber.java:209)
        at com.lowagie.text.Image.getInstance(Unknown Source)
        at com.lowagie.text.Image.getInstance(Unknown Source)
        at com.lowagie.text.pdf.PdfGraphics2D.drawImage(Unknown Source)
        at com.lowagie.text.pdf.PdfGraphics2D.drawImage(Unknown Source)
        at com.lowagie.text.pdf.PdfGraphics2D.drawImage(Unknown Source)
        at com.lowagie.text.pdf.PdfGraphics2D.drawImage(Unknown Source)
        at javax.swing.ImageIcon.paintIcon(ImageIcon.java:388)
        at com.servoy.j2db.util.gui.MyImageIcon.paintIcon(MyImageIcon.java:317) 
        at javax.swing.plaf.basic.BasicLabelUI.paint(BasicLabelUI.java:150)
        at javax.swing.plaf.ComponentUI.update(ComponentUI.java:143)
        at javax.swing.JComponent.paintComponent(JComponent.java:752) 
        at com.servoy.j2db.smart.dataui.AbstractScriptLabel.paintComponent(AbstractScriptLabel.java:172)
        at javax.swing.JComponent.printComponent(JComponent.java:1193)
        at javax.swing.JComponent.paint(JComponent.java:1033)
        at com.servoy.j2db.smart.dataui.AbstractScriptLabel.superModifiedPaint(AbstractScriptLabel.java:252)
        at com.servoy.j2db.smart.dataui.AbstractScriptLabel.paint(AbstractScriptLabel.java:272)
        at javax.swing.JComponent.print(JComponent.java:1175)
        at com.servoy.j2db.smart.dataui.AbstractScriptLabel.print(AbstractScriptLabel.java:227)
        at javax.swing.JComponent.printAll(JComponent.java:1121)
        at javax.swing.JComponent.paintChildren(JComponent.java:869)
        at com.servoy.j2db.smart.dataui.DataRenderer.paintChildren(DataRenderer.java:400)
        at javax.swing.JComponent.printChildren(JComponent.java:1206) 
        at javax.swing.JComponent.paint(JComponent.java:1041)
        at javax.swing.JComponent.print(JComponent.java:1175)
        at javax.swing.JComponent.printAll(JComponent.java:1121)
        at com.servoy.j2db.printing.DataRendererDefinition.printAll(DataRendererDefinition.java:599)

This happens right after starting the server. It was also happening prior to the application going down. Right now the system is up and we can hit the application but I fear it may come down again if we’re running out of memory.

Also the log is riddled with this error going back quite a long time:

RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object 2E21AE4D-6548-43AE-8F7C-36187913FAD2 of class com.servoy.j2db.util.UUID where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call.
java.lang.RuntimeException
        at org.mozilla.javascript.ScriptRuntime.warnAboutNonJSObject(ScriptRuntime.java:3750)
        at org.mozilla.javascript.ScriptRuntime.toBoolean(ScriptRuntime.java:287)
        at org.mozilla.javascript.Interpreter.stack_boolean(Interpreter.java:4878)
        at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3097)
        at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680)
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166)
        at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
        at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3134)
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
        at com.servoy.j2db.scripting.ScriptEngine.executeFunction(Unknown Source)
        at com.servoy.j2db.FormController.executeFunction(Unknown Source)
        at com.servoy.j2db.FormController.executeFunction(Unknown Source)
        at com.servoy.j2db.plugins.ClientPluginAccessProvider$MethodExecutor.run(Unknown Source)
        at com.servoy.j2db.server.headlessclient.WebClient.invokeAndWait(Unknown Source)
        at com.servoy.j2db.plugins.ClientPluginAccessProvider.executeMethod(Unknown Source)
        at com.servoy.j2db.server.headlessclient.WebClientPluginAccessProvider.executeMethod(Unknown Source)
        at com.servoy.j2db.scripting.FunctionDefinition.exec(Unknown Source)
        at com.servoy.j2db.scripting.FunctionDefinition.executeSync(Unknown Source)
        at com.servoy.extensions.plugins.file.FileProvider$1.uploadComplete(Unknown Source)
        at com.servoy.j2db.server.headlessclient.MainPage$18.uploadComplete(Unknown Source)
        at com.servoy.j2db.server.headlessclient.MediaUploadPage$2.onSubmit(Unknown Source)
        at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1595)
        at org.apache.wicket.markup.html.form.Form.process(Form.java:960)
        at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:922)
        at sun.reflect.GeneratedMethodAccessor303.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182)
        at org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:73)
        at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
        at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1252)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1331)