sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #11355
[Bug 1013396] Re: X-1.0rc3-931: Java heap space exhausted with long running script using Region.right() .below() .nearby().
Coming back to my defect with some new observations. I am not a java
expert, I am rather a newbie on java.
Some background information on my script: it is doing up to 200+ findAll()-Operations per minute. It consist of a main loop "while 1=1" nested with a few more loops. There is almost no sleep() or wait() operation. Mouse movement is max'ed. AutoWaitTimeout is set to 0.
The observations have been made on the test scripts attached to this defect as well.
It looks like java garbage collection sucks with default options. Adding "import gc" and a few "gc.collect()" within the loops slows down heap exhaust dramatically. For the test scripts it even avoids heap exhaust for more than one hour. My main script is now running stable for at least 12 hours.
I've developed an automatic restart function, i.e. after 12 hours the script leaves it's main loop and starts a windows batch file. The batch file needs a delay at the beginning (using "timeout" or ping) for a few seconds before starting the script again. Otherwise the new instance of my script is executed before java exits. If the new script instance is started before java exists, the memory is not freed but the new instance takes over the old.
--
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