← Back to team overview

sikuli-driver team mailing list archive

[Question #204098]: Meet OutOfMemoryError with JAVA

 

New question #204098 on Sikuli:
https://answers.launchpad.net/sikuli/+question/204098

When we try to prepare the test case script with java through the sikuli-script.jar, we found that we may meet java.lang.OutOfMemoryError sometimes. If we run the test case one by one in just one static main function, it always occurs this error around the 8th test case. Here is the detail error message as below:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
	at java.awt.image.DataBufferInt.<init>(Unknown Source)
	at java.awt.image.Raster.createPackedRaster(Unknown Source)
	at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
	at java.awt.image.BufferedImage.<init>(Unknown Source)
	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
	at org.sikuli.script.OpenCV.convertBufferedImageToByteArray(OpenCV.java:35)
	at org.sikuli.script.OpenCV.convertBufferedImageToMat(OpenCV.java:41)
	at org.sikuli.script.Finder.<init>(Finder.java:70)
	at org.sikuli.script.Region.doFind(Region.java:1029)
	at org.sikuli.script.Region$RepeatableFind.run(Region.java:1232)
	at org.sikuli.script.Region$Repeatable.repeat(Region.java:1203)
	at org.sikuli.script.Region.wait(Region.java:497)
We think it is caused by the image resource which is used in the previous test cases. I just wonder that if the sikuli API has prepared some methods so that we can use them to release  the image resource used before. Or could you please kindly geive us some other suggestions? Thank you very much for your help.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.