imacros crashing after 300-400 runs(Due to lack of RAM)

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
User avatar
vardipoor.m
Posts: 34
Joined: Sun Jan 17, 2021 8:58 am

imacros crashing after 300-400 runs(Due to lack of RAM)

Post by vardipoor.m » Thu Feb 25, 2021 9:24 am

hi
i use iMacros browser v12.6 Enterprise Edition and win 10 Pro x64

I run the following code about 300 to 400 times via vbs script.
My system has 8 GB of RAM and about 3 GB is empty.
After several non-stop runs by the do while loop, the RAM overflows and the iMacros crashes. The macro starts with an occupation of about 150 MB of ram and continues until the RAM is full(about 4 hours)
Does anyone know a way to troubleshoot or fix the problem? Thankful

i use HwInfo to logging memory(attached) second to second and imacros crashed at 5:38:6 (red highlighted).The point is, virtual memory is full, not physical memory
hwinfo and crash.zip
(82.44 KiB) Downloaded 154 times

Code: Select all

'VBS snippet generated by iMacros Editor
'See http://wiki.imacros.net/Web_Scripting for details on how to use the iMacros Scripting Interface.

Option Explicit
Dim macro1, macro2, macro3, macro1temp1, macro1temp2, macro2temp1, macroresetloop, macro3temp1, iret, iim, innerwhile, innerwhileend, outerwhile, outerwhileend, mac1allow, mac2allow, mac3allow
Dim mac2ex1, mac2ex2, mac2ex4, mac3ex2, sp, sp0, exitouterdo, macrologerror, irettext, urlcheck

Set iim = CreateObject ("imacros")
iret = iim.iimOpen("")

outerwhile = 1
innerwhile = 1
outerwhileend = 0 
innerwhileend = 0
exitouterdo = 0
Do While outerwhile > outerwhileend
   
   Do While innerwhile > innerwhileend
      
      mac1allow = 1
      mac2allow = 1
      mac3allow = 1
      
      ' Retry to goto site url 
      
      macro1 = "'***MACRO 1***" + vbNewLine      
      macro1 = macro1 + "SET !TIMEOUT_STEP 20" + vbNewLine
      macro1 = macro1 + "SET !WAITPAGECOMPLETE no" + vbNewLine
      macro1 = macro1 + "URL GOTO=***" + vbNewLine
      macro1 = macro1 + "TAG POS=1 TYPE=A ATTR=HREF:*** CONTENT=EVENT:FAIL_IF_FOUND" + vbNewLine
      macro1 = macro1 + "SET urlcheck {{!URLCURRENT}}" + vbNewLine
      
      If mac1allow=1 Then
         
         iim.iimDisplay("-->> MACRO 1")
         iret = iim.iimPlayCode(macro1)      
         
         If iret > 0 Then 
            
            urlcheck = iim.iimGet("URLCHECK")
            If urlcheck = "***" Then

            Else 
               
               macro1temp2 = "***MACRO1TEMP2***" + vbNewLine
               macro1temp2 = macro1temp2 + "TAG POS=1 TYPE=A ATTR=TXT:""Log in""&&HREF:https://***/login" + vbNewLine     
               macro1temp2 = macro1temp2 + "WAIT Seconds=1" + vbNewLine
               iim.iimDisplay("-->> macro1temp2")
               iim.iimPlayCode(macro1temp2) 
               
            End If
            
         ElseIf iret = -101 Then
            
            Errorlog("macro1-user stop error")
            MsgBox "user stop macro"
            exitouterdo = 1
            Exit Do
            
         ElseIf iret = -1350 Then
            
            Errorlog("macro1-site or internet error")
            iim.iimPlayCode("WAIT Seconds=5")
            Exit Do
            
         ElseIf iret = -1310 Then
            
            Errorlog("macro1-fail if found cabinet error")
            
            ' fail if found cabinet
            macro1temp1 = "'***MACRO1TEMP1***" + vbNewLine         
            macro1temp1 = macro1temp1 + "SET !TIMEOUT_STEP 20" + vbNewLine
            macro1temp1 = macro1temp1 + "URL GOTO=***" + vbNewLine
            macro1temp1 = macro1temp1 + "WAIT SECONDS=1" + vbNewLine         
            macro1temp1 = macro1temp1 + "TAG POS=1 TYPE=A ATTR=TXT:Exit" + vbNewLine
            iim.iimDisplay("-->> macro1temp1")
            iret = iim.iimPlayCode(macro1temp1)
            
            If iret > 0 Then
               
               Exit Do
               
            Else
               
               Errorlog("macro1temp1 error")
               Exit Do
               
            End If
            
         Else
            
            Errorlog("macro1 error")
            Exit Do
            
         End If
         
      End If  
      
      macro2 = "'***MACRO 2***" + vbNewLine
      macro2 = macro2 + "VERSION BUILD=1010 RECORDER=CR" + vbNewLine
      macro2 = macro2 + "SET !REPLAYSPEED fast" + vbNewLine
      macro2 = macro2 + "SET !WAITPAGECOMPLETE no" + vbNewLine
      macro2 = macro2 + "SET !EXTRACT_TEST_POPUP no" + vbNewLine
      macro2 = macro2 + "SET !TIMEOUT_STEP 30" + vbNewLine
      
      macro2 = macro2 + "'read loop number from file" + vbNewLine
      macro2 = macro2 + "SET !DATASOURCE ""reinvest-loop-data.txt""" + vbNewLine
      macro2 = macro2 + "SET !DATASOURCE_LINE 1" + vbNewLine
      macro2 = macro2 + "SET !loop {{!COL1}}" + vbNewLine
      macro2 = macro2 + "" + vbNewLine
      
      macro2 = macro2 + "'read user and pass from file" + vbNewLine
      macro2 = macro2 + "SET !DATASOURCE ""m userpass - reinvest.csv""" + vbNewLine
      macro2 = macro2 + "SET !DATASOURCE_LINE {{!loop}}" + vbNewLine
      macro2 = macro2 + "" + vbNewLine
      
      macro2 = macro2 + "'signin in the site with username and password and click reinvest" + vbNewLine
      macro2 = macro2 + "WAIT SECONDS=1" + vbNewLine
      macro2 = macro2 + "TAG POS=1 TYPE=INPUT:EMAIL ATTR=NAME:username CONTENT={{!COL1}}{{!COL2}}" + vbNewLine
      macro2 = macro2 + "SET !ENCRYPTION NO" + vbNewLine
      macro2 = macro2 + "SET !DATASOURCE_LINE 1" + vbNewLine
      macro2 = macro2 + "TAG POS=1 TYPE=INPUT:PASSWORD ATTR=NAME:password CONTENT={{!COL3}}" + vbNewLine
      macro2 = macro2 + "TAG POS=1 TYPE=INPUT:EMAIL ATTR=NAME:username EXTRACT=TXT" + vbNewLine
      macro2 = macro2 + "TAG POS=1 TYPE=BUTTON:SUBMIT FORM=ACTION:javascript:void(0); ATTR=TXT:Login&&CLASS:""mad_button d-block""&&TYPE:submit" + vbNewLine
      macro2 = macro2 + "TAG POS=1 TYPE=STRONG ATTR=* EXTRACT=TXT" + vbNewLine
      macro2 = macro2 + "TAG POS=1 TYPE=H4 ATTR=CLASS:m-2&&TXT:DOGE EXTRACT=TXT" + vbNewLine
      macro2 = macro2 + "TAG POS=R1 TYPE=H4 ATTR=CLASS:cloud-percent EXTRACT=TXT" + vbNewLine
      
      If mac2allow = 1 Then
         
         iim.iimDisplay("-->> MACRO 2")
         iret = iim.iimPlayCode(macro2)
         mac2ex1 = iim.iimGetExtract(1)
         mac2ex2 = iim.iimGetExtract(2)
         mac2ex4 = iim.iimGetExtract(4)     
         iim.iimSet "mac2ex1internal", mac2ex1
         ' if have no error go to next macro 
         If iret > 0 Then
            
            If mac2ex1<>mac2ex2 Then
               
               iret=iim.iimPlayCode("URL GOTO=***/cabinet")
               If iret>0 Then
                  
               Else
                  
                  Errorlog("mac2ex1<>mac2ex2 error")
                  Exit Do
                  
               End If 
               
            End If
            
            sp=split(mac2ex4,"DOGE")
            sp0=sp(0)
            
            If mac2ex4 = "0.000000000000000" Or mac2ex4 = "0 DOGE" Then
               
               macro2temp1 = "'***MACRO2TEMP1***" + vbNewLine
               macro2temp1 = macro2temp1 + "SET !WAITPAGECOMPLETE yes" + vbNewLine
               macro2temp1 = macro2temp1 + "URL GOTO=***/cabinet" + vbNewLine
               macro2temp1 = macro2temp1 + "TAG POS=1 TYPE=BUTTON ATTR=TXT:Start&&CLASS:""button_white start-mining""&&DATA-CHAIN:DOGE" + vbNewLine
               
               iim.iimDisplay("-->> macro2temp1")
               iret=iim.iimplaycode(macro2temp1)
               
               If iret>0 Then
                  
               Else
                  
                  Errorlog("macro2temp1 error")
                  Exit Do
                  
               End If 
               
            End If 
            
         ElseIf iret = -101 Then
            
            MsgBox "user stop macro2"
            Errorlog("macro2-user stop error")
            exitouterdo = 1
            Exit Do
            
         ElseIf iret = -1350 Then
            Errorlog("macro2-site or internet error")
            Exit Do

         ElseIf iret = -1240 Then
            
            Errorlog("macro2-end of userpass list error")
            resetloopsub()
            Exit Do
            
         Else
            
            Errorlog("macro2 error")
            Exit Do
            
         End If
         
      End If
      
      macro3 = "'***MACRO 3***" + vbNewLine
      macro3 = macro3 + "SET !REPLAYSPEED medium" + vbNewLine
      macro3 = macro3 + "SET !WAITPAGECOMPLETE no" + vbNewLine
      macro3 = macro3 + "SET !EXTRACT_TEST_POPUP no" + vbNewLine
      macro3 = macro3 + "SET !TIMEOUT_STEP 30" + vbNewLine
      macro3 = macro3 + "" + vbNewLine
      macro3 = macro3 + "'extract some data" + vbNewLine
      macro3 = macro3 + "'***extract doge number with anchor doge lable(always anchor must have pos=1))***" + vbNewLine
      macro3 = macro3 + "TAG POS=1 TYPE=H4 ATTR=CLASS:m-2&&TXT:DOGE EXTRACT=TXT" + vbNewLine
      macro3 = macro3 + "SET !var3 {{!EXTRACT}}" + vbNewLine
      macro3 = macro3 + "SET !EXTRACT NULL" + vbNewLine
      macro3 = macro3 + "TAG POS=R1 TYPE=H4 ATTR=CLASS:cloud-percent EXTRACT=TXT" + vbNewLine
      macro3 = macro3 + "SET !var4 {{!EXTRACT}}" + vbNewLine
      macro3 = macro3 + "SET !EXTRACT NULL" + vbNewLine
      macro3 = macro3 + "TAG POS=1 TYPE=BUTTON ATTR=TXT:Reinvest&&CLASS:""button_white reinvest""&&DATA-CHAIN:DOGE" + vbNewLine
      macro3 = macro3 + "TAG POS=1 TYPE=DIV ATTR=TXT:""Min*""&&CLASS:ui-pnotify-text&&ARIA-ROLE:alert CONTENT=EVENT:FAIL_IF_FOUND" + vbNewLine
      macro3 = macro3 + "SET !REPLAYSPEED fast" + vbNewLine
      macro3 = macro3 + "SET !DATASOURCE ""reinvest-loop-data.txt""" + vbNewLine
      macro3 = macro3 + "SET !DATASOURCE_LINE 1" + vbNewLine
      macro3 = macro3 + "SET !VAR0 EVAL(""{{!COL1}}+1"")" + vbNewLine
      macro3 = macro3 + "SET !DATASOURCE ""fake.txt""" + vbNewLine
      macro3 = macro3 + "'increase loop number(go to next user pass at next time that macro3 run)" + vbNewLine
      macro3 = macro3 + "FILEDELETE NAME=C:\Users\mv\Documents\imacros\DataSources\reinvest-loop-data.txt" + vbNewLine
      macro3 = macro3 + "WAIT seconds=1" + vbNewLine
      macro3 = macro3 + "ADD !EXTRACT {{!var0}}" + vbNewLine
      macro3 = macro3 + "ADD !EXTRACT {{!NOW:mm/dd/yyyy}}" + vbNewLine
      macro3 = macro3 + "ADD !EXTRACT {{!NOW:hh:nn:ss}}" + vbNewLine
      macro3 = macro3 + "SAVEAS TYPE=EXTRACT FOLDER=C:\Users\mv\Documents\imacros\DataSources FILE=reinvest-loop-data.txt" + vbNewLine
      macro3 = macro3 + "ADD !EXTRACT ""after reinvest""" + vbNewLine
      macro3 = macro3 + "SET !var5 {{!EXTRACT}}" + vbNewLine
      macro3 = macro3 + "SET !EXTRACT NULL" + vbNewLine
      macro3 = macro3 + "TAG POS=1 TYPE=H3 ATTR=CLASS:""total gh"" EXTRACT=TXT" + vbNewLine
      macro3 = macro3 + "SET !var6 {{!EXTRACT}}" + vbNewLine
      macro3 = macro3 + "SET !EXTRACT NULL" + vbNewLine
      macro3 = macro3 + "URL GOTO=***/cabinet/operations" + vbNewLine
      macro3 = macro3 + "TAG POS=2 TYPE=TD ATTR=* EXTRACT=TXT" + vbNewLine
      macro3 = macro3 + "SET !var7 {{!EXTRACT}}" + vbNewLine
      macro3 = macro3 + "SET !EXTRACT NULL" + vbNewLine
      macro3 = macro3 + "TAG POS=1 TYPE=TH ATTR=TXT:DESCRIPTION EXTRACT=TXT" + vbNewLine
      macro3 = macro3 + "SET !var8 {{!EXTRACT}}" + vbNewLine
      macro3 = macro3 + "SET !EXTRACT NULL" + vbNewLine
      macro3 = macro3 + "TAG POS=4 TYPE=TD ATTR=* EXTRACT=TXT" + vbNewLine
      macro3 = macro3 + "SET !var9 {{!EXTRACT}}" + vbNewLine
      macro3 = macro3 + "SET !EXTRACT NULL" + vbNewLine
      macro3 = macro3 + "" + vbNewLine
      macro3 = macro3 + "'TAG POS=1 TYPE=DIV ATTR=CLASS:ui-pnotify-text EXTRACT=TXT" + vbNewLine
      macro3 = macro3 + "'TAG POS=1 TYPE=DIV ATTR=TXT:*&&CLASS:ui-pnotify-text&&ARIA-ROLE:alert EXTRACT=TXT" + vbNewLine
      macro3 = macro3 + "SET !WAITPAGECOMPLETE yes" + vbNewLine
      macro3 = macro3 + "TAG POS=1 TYPE=A ATTR=TXT:Exit" + vbNewLine
      macro3 = macro3 + "ADD !EXTRACT {{mac2ex1internal}}" + vbNewLine
      macro3 = macro3 + "ADD !EXTRACT {{!var3}}" + vbNewLine
      macro3 = macro3 + "ADD !EXTRACT {{!var4}}" + vbNewLine
      macro3 = macro3 + "ADD !EXTRACT {{!var5}}" + vbNewLine
      macro3 = macro3 + "ADD !EXTRACT {{!var6}}" + vbNewLine
      macro3 = macro3 + "ADD !EXTRACT ""SITE TIME :""" + vbNewLine
      macro3 = macro3 + "ADD !EXTRACT {{!var7}}" + vbNewLine
      macro3 = macro3 + "ADD !EXTRACT {{!var8}}" + vbNewLine
      macro3 = macro3 + "ADD !EXTRACT {{!var9}}" + vbNewLine
      macro3 = macro3 + "ADD !EXTRACT ""PC TIME :""" + vbNewLine
      macro3 = macro3 + "ADD !EXTRACT {{!NOW:mm/dd/yyyy}}" + vbNewLine
      macro3 = macro3 + "ADD !EXTRACT {{!NOW:hh:nn:ss}}" + vbNewLine
      macro3 = macro3 + "SAVEAS TYPE=EXTRACT FOLDER=C:\Users\mv\Documents\iMacros\Downloads\Reinvest FILE=m-REINVEST-ex-data-temp{{!NOW:mmddyyyy}}.txt" + vbNewLine
      macro3 = macro3 + "" + vbNewLine
      macro3 = macro3 + "'TAG POS=1 TYPE=A ATTR=TXT:Log<SP>in" + vbNewLine
      macro3 = macro3 + "'TAG POS=1 TYPE=INPUT:EMAIL FORM=ID:login ATTR=ID:exampleInputEmail1 CONTENT={{!col1}}" + vbNewLine
      macro3 = macro3 + "'SET !DATASOURCE_LINE 1" + vbNewLine
      macro3 = macro3 + "'TAG POS=1 TYPE=INPUT:PASSWORD FORM=ID:login ATTR=ID:exampleInputPassword1 CONTENT={{!col2}}" + vbNewLine
      macro3 = macro3 + "'TAG POS=1 TYPE=BUTTON FORM=ID:login ATTR=TXT:Login" + vbNewLine
      macro3 = macro3 + "'TAG POS=1 TYPE=A ATTR=TXT:Bonuses" + vbNewLine
      macro3 = macro3 + "'WAIT seconds=4" + vbNewLine
      macro3 = macro3 + "" + vbNewLine
      
      If mac3allow=1 Then
         
         iim.iimDisplay("-->> MACRO 3")   
         iret = iim.iimPlayCode(macro3)
         iim.iimSet "mac2ex1internal1", mac2ex1
         mac3ex2 = iim.iimGet("!VAR4")
         iim.iimSet "mac3ex2internal", mac3ex2
         If iret > 0 Then
            
         ElseIf iret = -1310 Then 
            
            ' fail if found min* popup
            Errorlog("macro3-fail if found min* error")
            macro3temp1 = "'***macro3temp1***" + vbNewLine
            macro3temp1 = macro3temp1 + "TAG POS=1 TYPE=A ATTR=TXT:Exit" + vbNewLine
            macro3temp1 = macro3temp1 + "ADD !EXTRACT ""{{mac2ex1internal1}}""" + vbNewLine 
            macro3temp1 = macro3temp1 + "ADD !EXTRACT ""{{mac3ex2internal}}""" + vbNewLine        
            macro3temp1 = macro3temp1 + "ADD !EXTRACT ""Dodge is less than reinvest.""" + vbNewLine
            macro3temp1 = macro3temp1 + "ADD !EXTRACT {{!NOW:mm/dd/yyyy}}" + vbNewLine
            macro3temp1 = macro3temp1 + "ADD !EXTRACT {{!NOW:hh:nn:ss}}" + vbNewLine
            macro3temp1 = macro3temp1 + "SAVEAS TYPE=EXTRACT FOLDER=C:\Users\mv\Documents\iMacros\Downloads\Reinvest FILE=m-REINVEST-ex-data-temp{{!NOW:mmddyyyy}}.txt" + vbNewLine
            macro3temp1 = macro3temp1 + "SET !DATASOURCE ""reinvest-loop-data.txt""" + vbNewLine
            macro3temp1 = macro3temp1 + "SET !DATASOURCE_LINE 1" + vbNewLine
            macro3temp1 = macro3temp1 + "SET !VAR0 EVAL(""{{!COL1}}+1"")" + vbNewLine
            macro3temp1 = macro3temp1 + "SET !DATASOURCE ""fake.txt""" + vbNewLine
            macro3temp1 = macro3temp1 + "'increase loop number(go to next user pass and run from first macro)" + vbNewLine
            macro3temp1 = macro3temp1 + "FILEDELETE NAME=C:\Users\mv\Documents\imacros\DataSources\reinvest-loop-data.txt" + vbNewLine
            macro3temp1 = macro3temp1 + "WAIT seconds=1" + vbNewLine
            macro3temp1 = macro3temp1 + "ADD !EXTRACT {{!var0}}" + vbNewLine
            macro3temp1 = macro3temp1 + "ADD !EXTRACT {{!NOW:mm/dd/yyyy}}" + vbNewLine
            macro3temp1 = macro3temp1 + "ADD !EXTRACT {{!NOW:hh:nn:ss}}" + vbNewLine
            macro3temp1 = macro3temp1 + "SAVEAS TYPE=EXTRACT FOLDER=C:\Users\mv\Documents\imacros\DataSources FILE=reinvest-loop-data.txt" + vbNewLine
            
            iim.iimDisplay("-->> macro3temp1")     
            iret=iim.iimPlayCode(macro3temp1)
            
            If iret > 0 Then            

            Else
               
               Errorlog("macro3temp1 error")
               
            End If
            
         ElseIf iret = -101 Then
         
            ' if user click on stop
            MsgBox "user stop macro3"
            Errorlog("macro3-user stop error")
            exitouterdo = 1
            Exit Do
            
         ElseIf iret < 0 And iret <> -1240 Then
            
            Errorlog("macro3-*-error")
            Exit Do
            
         Else
            
            Errorlog("macro3 error")
            Exit Do
            
         End If
      End If
      
   Loop
   
   If exitouterdo = 1 Then
      Exit Do
   End If   
   
Loop

iim.iimClose()

Sub outerwhileendsub()
   
   outerwhileend = 1
   
End Sub
Sub innerwhileendsub()
   
   innerwhileend = 1
   
End Sub
Sub resetloopsub()
   
   macroresetloop = "'***macroresetloop***" + vbNewLine
   macroresetloop = macroresetloop + "FILEDELETE NAME=C:\Users\mv\Documents\imacros\DataSources\reinvest-loop-data.txt" + vbNewLine
   macroresetloop = macroresetloop + "WAIT seconds=1" + vbNewLine
   macroresetloop = macroresetloop + "ADD !EXTRACT 1" + vbNewLine
   macroresetloop = macroresetloop + "ADD !EXTRACT ""loop reseted""" + vbNewLine            
   macroresetloop = macroresetloop + "ADD !EXTRACT {{!NOW:mm/dd/yyyy}}" + vbNewLine
   macroresetloop = macroresetloop + "ADD !EXTRACT {{!NOW:hh:nn:ss}}" + vbNewLine
   macroresetloop = macroresetloop + "SAVEAS TYPE=EXTRACT FOLDER=C:\Users\mv\Documents\imacros\DataSources FILE=reinvest-loop-data.txt" + vbNewLine
   iim.iimDisplay("-->> macroresetloop")
   iret=iim.iimplaycode(macroresetloop)
   
   If iret > 0 Then
      
   Else
      
      Errorlog("macroresetloop error")
      
   End If
   
End Sub
Sub Errorlog(str)

   If iret = -1310 Then

   Else
      
      irettext=iim.iimGetErrorText()
      iim.iimSet "iretinternal",iret
      iim.iimSet "irettextinternal",irettext
      iim.iimset "strinternal", str
      macrologerror = "'***MACROLOGERROR***" + vbNewLine
      macrologerror = macrologerror + "ADD !EXTRACT  {{mac2ex1internal1}}" + vbNewLine
      macrologerror = macrologerror + "ADD !EXTRACT  {{strinternal}}" + vbNewLine      
      macrologerror = macrologerror + "ADD !EXTRACT  {{iretinternal}}" + vbNewLine            
      macrologerror = macrologerror + "ADD !EXTRACT  {{irettextinternal}}" + vbNewLine                        
      macrologerror = macrologerror + "ADD !EXTRACT {{!NOW:mm/dd/yyyy}}" + vbNewLine
      macrologerror = macrologerror + "ADD !EXTRACT {{!NOW:hh:nn:ss}}" + vbNewLine
      macrologerror = macrologerror + "ADD !EXTRACT ""NEXTERROR""" + vbNewLine
      macrologerror = macrologerror + "SAVEAS TYPE=EXTRACT FOLDER=C:\Users\mv\Documents\iMacros\Downloads\ErrorLogs FILE=LOG-{{!NOW:mmddyyyy}}.txt" + vbNewLine
      
      iim.iimDisplay("-->> error log")  
      iim.iimplaycode(macrologerror)
      
   End If
   
End Sub
Thanks to the clever and clean administrator of this forum
User avatar
vardipoor.m
Posts: 34
Joined: Sun Jan 17, 2021 8:58 am

Re: imacros crashing after 300-400 runs(Due to lack of RAM)

Post by vardipoor.m » Thu Feb 25, 2021 1:22 pm

These two photos were taken from the start time (after two repetitions) and the end time.(almost before the crash).
start.jpg
end.jpg
Thanks to the clever and clean administrator of this forum
User avatar
vardipoor.m
Posts: 34
Joined: Sun Jan 17, 2021 8:58 am

Re: imacros crashing after 300-400 runs(Due to lack of RAM)

Post by vardipoor.m » Fri Feb 26, 2021 6:50 am

ah :( i use a if statement to close and open in each 100 loop count to handle this error

Code: Select all

      If iret > 0 Then
         
         closeopencount = closeopencount + 1 
         
      End If
      If closeopencount > 100 Then
         
         closeopencount = 0
         iim.iimClose()
         iim.iimOpen("-runner")
         
      End If

but now when i run it in the background, if my pc be locked imacros get -3 error until i unlock my pc. why? What's wrong with my code snippet?
Thanks to the clever and clean administrator of this forum
User avatar
vardipoor.m
Posts: 34
Joined: Sun Jan 17, 2021 8:58 am

Re: imacros crashing after 300-400 runs(Due to lack of RAM)

Post by vardipoor.m » Fri Feb 26, 2021 9:24 am

hmmm i find the solution :)

lock screen is problem. I unchecked the "on resume, display logon screen" on the screen saver and the problem was solved. may help others.

But I could not really solve the memory overflow problem :( (solved with a trick). I can not even understand why?
According to the iMacros wiki, all the memory is empty after each run, but I see that this is not the case!
Thanks to the clever and clean administrator of this forum
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: imacros crashing after 300-400 runs(Due to lack of RAM)

Post by Tom, Tech Support » Tue Mar 02, 2021 9:32 am

vardipoor.m wrote:
Fri Feb 26, 2021 9:24 am
hmmm i find the solution :)

lock screen is problem. I unchecked the "on resume, display logon screen" on the screen saver and the problem was solved. may help others.

But I could not really solve the memory overflow problem :( (solved with a trick). I can not even understand why?
According to the iMacros wiki, all the memory is empty after each run, but I see that this is not the case!
One thing you need to keep in mind when using a product like iMacros is that web browsers in general are not designed for automation. This even applies to the iMacros browser to the extent that it is using the core IE engine (in 12.6 and earlier; Chromium in iMacros 2021 and later). Attempting to push browsers beyond the limits of typical, ordinary usage patterns performed by actual humans invariably leads to memory issues - mostly due to leaks in the browsers themselves and not necessarily iMacros - and other weird side effects that can be difficult to troubleshoot as discussed in the following article:

http://wiki.imacros.net/Web_Testing#Q:_ ... iMacros.3F

As you discovered, the best way to offset and avoid these types of issues is by using the iMacros scripting interface to periodically restart the browser during your automated processes.
Regards,

Tom, iMacros Support
User avatar
vardipoor.m
Posts: 34
Joined: Sun Jan 17, 2021 8:58 am

Re: imacros crashing after 300-400 runs(Due to lack of RAM)

Post by vardipoor.m » Tue Mar 02, 2021 12:13 pm

Thankful
If you can put a topic in the wiki called Memory Leak Prevention. It gets better. By giving an example.
Thanks to the clever and clean administrator of this forum
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: imacros crashing after 300-400 runs(Due to lack of RAM)

Post by Tom, Tech Support » Wed Mar 03, 2021 10:24 am

vardipoor.m wrote:
Tue Mar 02, 2021 12:13 pm
Thankful
If you can put a topic in the wiki called Memory Leak Prevention. It gets better. By giving an example.

FAQ: How to mitigate browser memory leaks and crashes?
Regards,

Tom, iMacros Support
User avatar
vardipoor.m
Posts: 34
Joined: Sun Jan 17, 2021 8:58 am

Re: imacros crashing after 300-400 runs(Due to lack of RAM)

Post by vardipoor.m » Wed Mar 03, 2021 8:19 pm

thanks
Thanks to the clever and clean administrator of this forum
Post Reply