sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #11209
[Bug 1013396] Re: X-1.0rc3-931: Java heap space exhausted with long running script using Region.right() .below() .nearby().
I looked into the sources:
It is not the FindFailed option dialog.
The problem is the ScreenHighLighter (the thing that makes the red
frames around the screen when capturing or when using Region.highlight.
The 3 affected methods use the "new Region" in a different way, than the
other 2 methods. This is a known inconsistency on the Java level of "new
Region" (which is tagged as deprecated) and Region.create(), which makes
problems when trying to use the observe feature in Java.
The basic problem is, that with Region.right() a new Screen object is
created, though already one exists and hence a new ScreenHighlighter
object. On the first glance I cannot see, why these Screen and
ScreenHiighlighter objects are not released together with the Region
objects.
--
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1013396
Title:
X-1.0rc3-931: Java heap space exhausted with long running script using
Region.right() .below() .nearby().
Status in Sikuli:
Confirmed
Bug description:
******** details - workaround
only Region.right() and .below() and .nearby() are affected.
.above() and .left() are ok.
There is no other workaround, than to make your own functions, to get
a Region right or below or nearby of a given region.
-------------------------------------------------------------------------------------------------------------------
It took me a while* to track this one down:
NO memory leak:
def getNumbers(numType, region):
return 0
def test()
x=regions['topLeft'].find("JI.png")
getNumbers("topLeft", x) # <----<----<---- Region
while True:
test()
MEMORY LEAK:
def getNumbers(numType, region):
return 0
def test()
x=regions['topLeft'].find("JI.png")
getNumbers("topLeft", x.right(75)) #<---<---<--- Region.right(x)
while True:
test()
System: win7 64bit
JRE 1.6.32 (JRE1.7.04 tested as well)
Sikuli X1.0rc3(905) (1.0RC930 tested as well)
I've tested a few variations of the code above already. I will go on,
since that script is essential to a project I am running.
PS: getNumbers is my own text (number) recognition algorithm since
region.text() isn't working yet.
* "a while" == 12 days - anyway, sikuli is really good for it's
purpose
To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1013396/+subscriptions
References