Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Fri May 24, 2019 11:40 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Memory Leak?
Thanked: 0 time(s)  Unread post Posted: Wed May 01, 2019 8:52 pm 
New User
New User



Joined: Mon Mar 20, 2017 9:22 am
Posts: 9
Been thanked: 0 time(s)
Has thanked: 3 time(s)
Contribution Points: 13
Code:
Error: Unknown
System.ArgumentException: Parameter is not valid.
   at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
   at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
   at BlueEye.Wizard.Helpers.ScreenHelper.GetRegion(Int32 xFrom, Int32 xTo, Int32 yFrom, Int32 yTo)
   at BlueEye.Macros.Helpers.ColorHelper.FindPattern(PixelPattern pattern, Int32 accuracyRange, Boolean center, Nullable`1 near, Nullable`1 range, Nullable`1 closestTo)
   at BlueEye.Macros.Helpers.ColorHelper.FindPattern(PixelPattern pattern, Int32 accuracyRange, Boolean center)
   at BlueEye.Macros.Criterias.Color.Constraints.PixelPatternCanBeLocatedOnScreen.IsSatisfied(IDictionary`2 variables)
   at BlueEye.Macros.BaseClasses.BaseCriteria.<>c__DisplayClass1.<HasBeenMet>b__0(IConstraint c)
   at System.Linq.Enumerable.All[TSource](IEnumerable`1 source, Func`2 predicate)
   at BlueEye.Macros.BaseClasses.BaseCriteria.HasBeenMet(IDictionary`2 variables)
   at BlueEye.Macros.MacroStep.evaluateCriterias(Macro owner, IDictionary`2 variables)Parameter is not valid.


My macro works very well for several hours, but at some point it will stop functioning and it starts throwing errors of this type, probably some sort of memory leak?


Top
 Profile  
Reply with quote  
 Post subject: Re: Memory Leak?
Thanked: 0 time(s)  Unread post Posted: Wed May 01, 2019 10:05 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1891
Location: USA
Been thanked: 405 time(s)
Has thanked: 33 time(s)
Contribution Points: 16540
If it takes several hours to happen, then it's probably a memory leak...although there may be something you could do with the script to prevent it also.

In order to troubleshoot a memory leak, we would need more information; your OS, BEM version, BEM driver version you're using and if you're using virtual drivers, and finally a copy of the script/macro.
- for example you could be on Win10, but using Win7 virtual drivers in compatibility mode...that information would help.

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers


Top
 Profile  
Reply with quote  
 Post subject: Re: Memory Leak?
Thanked: 0 time(s)  Unread post Posted: Thu May 02, 2019 8:36 am 


windows 10 OS, 2.61 BEM, no virtual drivers and no compatibility mode.

Heres another error I received after about 5 hrs of runtime.

Code:
Checking if: Color.Pixel pattern can be located on screen(Pattern: 152,175,194,21,-3,161,185,207,-21,14,130,147,163,24,3,125,141,156,22,-11,198,198,198,12,4,197,197,197,12,2,196,197,197,6,0,196,196,197,6,-1,196,196,196,24,-2,197,197,197,0,-1,197,197,197,-114,48,193,193,193,0,-5,202,202,202,4,0,190,190,191,0,5,193,193,193,3,0,191,191,191,3,0,197,197,197,3,-2,190,190,190,-1,5,178,178,179,71,-3,192,192,192,3,1,189,189,190,3,-1,192,192,192,3,-1,189,189,190,3,0,192,192,192,4,-1,192,192,192,4,1,192,192,192,3,1,192,192,193,3,1,190,190,190,3,0,192,192,193,3,0,190,190,190,30,1,194,194,194,3,-3,191,191,191, Range: 10)
Error: Unknown
Error: Unknown
System.OutOfMemoryException: Out of memory.
   at System.Drawing.Bitmap.LockBits(Rectangle rect, ImageLockMode flags, PixelFormat format, BitmapData bitmapData)
   at System.Drawing.Bitmap.LockBits(Rectangle rect, ImageLockMode flags, PixelFormat format)
   at BlueEye.Macros.Helpers.ColorHelper.SafeLockBitmap(Bitmap& bitmap, Int32& width, Int32& height)
   at BlueEye.Macros.Helpers.ColorHelper.FindPattern(PixelPattern pattern, Int32 accuracyRange, Boolean center, Nullable`1 near, Nullable`1 range, Nullable`1 closestTo)
   at BlueEye.Macros.Helpers.ColorHelper.FindPattern(PixelPattern pattern, Int32 accuracyRange, Boolean center)
   at BlueEye.Macros.Criterias.Color.Constraints.PixelPatternCanBeLocatedOnScreen.IsSatisfied(IDictionary`2 variables)
   at BlueEye.Macros.BaseClasses.BaseCriteria.<>c__DisplayClass1.<HasBeenMet>b__0(IConstraint c)
   at System.Linq.Enumerable.All[TSource](IEnumerable`1 source, Func`2 predicate)
   at BlueEye.Macros.BaseClasses.BaseCriteria.HasBeenMet(IDictionary`2 variables)
   at BlueEye.Macros.MacroStep.evaluateCriterias(Macro owner, IDictionary`2 variables)Out of memory.


Top
  
Reply with quote  
 Post subject: Re: Memory Leak?
Thanked: 0 time(s)  Unread post Posted: Thu May 02, 2019 1:33 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1891
Location: USA
Been thanked: 405 time(s)
Has thanked: 33 time(s)
Contribution Points: 16540
I see it's happening after doing a pixel pattern search. Do you have small "macro.pauses" within your script every once in awhile? It helps to increase performance especially in long macros. BEM should dump search cache every 100ms, but using both some pauses and adding a manual "flush screen dump cache" may prevent the error.

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group