[2.0.x] Possible memory leak with Region objects in long running Jython scripts

Bug #1532541 reported by RaiMan
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SikuliX
Confirmed
Undecided
RaiMan

Bug Description

bug tracked on GitHub: https://github.com/RaiMan/SikuliX1/issues/323

********* for more information see the related question

--------------------------------------------------------

I've been trying to make a script that looks for specific images, clicks on them, and then clicks on the next button after that.
Currently, it does that - but it's incredibly slow, it can take up to two minutes just to click on 4-6 images/buttons. Overall there are about 10 images it's looking for all at once as they randomly pop up.

I've tried adding a region to my code to help speed it up but I couldn't figure it out as I'm extremely new to even the most basic of script writing. Below is the code I'm currently using:
while True:
    Settings.ObserveScanRate = 18
    Settings.WaitScanRate = 15
    Settings.MoveMouseDelay = 0
    Settings.MouseDelay = 0

    CurrentBarRegion = ( Region(689,294,1059,685))

    if exists (Pattern("1452165008359.png").similar(0.76), 0): hover (getLastMatch())
    if exists ("1452165060367.png", 0): click(getLastMatch())

There's about eight more if exists with pictures in it but that's the code.
Some thought as to why Sikulix is slow: all images are very similar with light blue colors, seems Sikulix doesn't like light blue that much. Maybe the method I'm using is bad and slowing down the process as well. Could try using text search possibly, all buttons have big text in them.

 Pictures are all high quality, my monitor is 24 inches, 1920x1080 resolution, lots of ram good CPU etc so it can't be due to that. If anyone can help me speed up Sikulix by showing me how to put in region properly or another method I'd greatly appreciate it. Thanks!

RaiMan (raimund-hocke)
description: updated
Changed in sikuli:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.1
Revision history for this message
Jasper (masterjasper19) wrote :

Hey, RaiMan I just wanted to let you know I may have pinpointed the issue of the no memory error - It seems to only do it when you save and run after adding a new picture or changing code. (It may just be adding new pictures, I'm not sure on this one!)

I caught onto this a little bit last night and did some tests and it sure seems that it only crashes if you save your profile and run it right after.

If you make changes to a profile and save and exit sikuliX completely and reopen it before running everything is fine. If you save and run right away, that's when you get memory issues.

I'm not sure if this is of any help to you, but I wanted to let you know just on the chance it may help pinpoint the issue.

Revision history for this message
RaiMan (raimund-hocke) wrote :

great thanks for the finding.

This surely helps, to at least get a point, where to start the debugging.

Revision history for this message
Glenn Tanner (glenntanner3) wrote :

Hi RaiMan,

Hope this test helps.

Arch Linux
java-11-openjdk
sikulix-2.0.1

Memory usage increases with every run by about 60-90M, VNC library in use. Tested by turning off auto-save and changing nothing, just hit 'run' button: Open->356->run->540->run->627 MB of RES memory.

RaiMan (raimund-hocke)
Changed in sikuli:
milestone: 1.1.1 → 2.1.0
summary: - [1.1.0] Possible memory leak with Region objects in long running Jython
+ [2.0.x] Possible memory leak with Region objects in long running Jython
scripts
RaiMan (raimund-hocke)
description: updated
Changed in sikuli:
status: In Progress → Confirmed
importance: Medium → Undecided
milestone: 2.1.0 → 2.0.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.