← Back to team overview

sikuli-driver team mailing list archive

[Bug 1013396] Re: Java heap space exhausted with long running script

 

Well, I don't agree fully yet. I have prepared two skl-versions of the
following script:

def getNumbers(numType, region):
    return 0

def test():
    x=region['3'].find("JI.png")
#    y=x.right(75)                  # <<<<<<<< line activated in "region.right - ML.skl
    y=x                                        # <<<<<<<< line activated in "region.skl"
    getNumbers("topLeft", y)


exactRegion=find("JI.png")
region={}
for i in range(10):
    region[str(i)]=Region(exactRegion.x-100, exactRegion.y-100, 200, 200)
    region[str(i)].setAutoWaitTimeout(0.0)
    region[str(i)].setFindFailedResponse(SKIP)
while True:
    test()

Both scripts are attached. I attached a screenshot as well. Open the
screenshot anywhere on your screen using any software (I tested using
windows photo viewer). Run both scripts at about the same time and
observe their memory usage in windows task manager.

While writing this text, one script went from 145-150 up to 210. That's
the ML-script. The other one stays constant at 145-150.

I've figured out the setAutoWaitTimeout(0.0) is important. I guess it's
just boosting the number of find-operations per second and thus creating
a much easier observable result.


** Attachment added: "example causing memory leak"
   https://bugs.launchpad.net/sikuli/+bug/1013396/+attachment/3190692/+files/Region.right-ML.skl

-- 
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:
  Java heap space exhausted with long running script

Status in Sikuli:
  New

Bug description:
  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