Posts: 15
Threads: 3
Joined: Sep 2006
Hi!
I want to ask about the RAM that uses QM. I have searched about "memory" and "RAM", but I haven't found anything.
The problem is that QM stops to run a macro, and the problem I think is the amount of RAM that needs this app.
It "eats" up to 250MB (I have seen so much RAM, but I don't discard that sometimes can need more RAM) and my question is: Is it normal???? Or it's is just a bad program?
If the problem is the second case, the code, I'll explain a bit the runtime:
It's a "for" sentence that repeats the code 5000 times.
Each time, loads a page, checks if the page is the correct, copy the content to clipboard (Ctrl+C), and paste it into a file (_s.getclip; _s.setfile)
In fact, the "for" sentence repeats between 1500 and 2000 times, before the macro crashes..
I hope you can help me... and understand me. Sorry for my bad English.
IzK
Posts: 12,073
Threads: 140
Joined: Dec 2002
It isn't normal. Please post whole macro or macros that boost memory usage.
Posts: 15
Threads: 3
Joined: Sep 2006
oks.
It's the macro.
Acc accion
Htm OI
str filedate="20060920"
str valueA = "1"
str valueB = "1"
str filename
int Counter=val(valueB)
Counter = Counter - 1
;error
LogIn ;; Call a macro to log into the web.
;;;A bit explanation of the macro: Close all "Internet explorer", loads the web in a new internet explorer window and do login
;SolicitudNoTerminada
OI=htm("A" "---" "" win(" Internet Explorer" "IEFrame") "1/1" 9 0x21 180)
err
,goto error
;;;if whe can find this item, the web is reloaded.
OI.Click
OI=htm("TD" "---" "" win(" Internet Explorer" "IEFrame") "1/2" 11 0x1 180)
if(!OI) goto error
;;;the same
1
;;;The filename depends of the valueA. Each valueA, requires a new file
filename = "C:\txts\"
filename + filedate
filename + " - N"
filename + valueA
filename + ".txt"
;;;Now begin the loop process
;Scanning
;;;Setting the current values, and load the web
OI=htm("INPUT" "---" "" win(" Internet Explorer" "IEFrame") "1/2" 4 0x221 180)
OI.SetText(valueA)
OI=htm("INPUT" "---" "" win(" Internet Explorer" "IEFrame") "1/2" 7 0x221 180)
OI.SetText(valueB)
OI=htm("INPUT" "---" "" win(" Internet Explorer" "IEFrame") "1/2" 9 0x421 180)
OI.Click
;;;End of settings
_s="---"
_s + valueA
_s + "/"
_s + valueB
OI=htm("TD" _s "" win(" Internet Explorer" "IEFrame") "1/2" 11 0x21 180)
err
,goto SolicitudNoTerminada
;;;if the web is not loaded in 180s, whe redone all the process....
OI.SetFocus
OI.Click
0.25
;COPYCLIP
_s.all
key CeCc
1
_s.getclip
err
,goto COPYCLIP
;;;Sometimes I have received an error when copying the data into the clipboard.
;;;For this reason, I needed to put this loop.
_s.setfile(filename -1 -1 1) ;; Insert data into file
_s.all
valueB=val(valueB)+1
if (val(valueB) > 1000)
,valueB = "1"
,valueA = val(valueA)+1
,filename = "C:\txts\"
,filename + filedate
,filename + " - N"
,filename + valueA
,filename + ".txt"
,if (val(valueA) > 5)
,,goto END
,goto error ;; This was a new try to correct the problem, loading the web again, without any result
goto Scanning
;END
run "D:\WINNT\system32\net.exe" "send 192.168.1.2 Fin de la macro" "" "" 16
;;;Send a message to other computer in the LAN, when all is done.
Posts: 12,073
Threads: 140
Joined: Dec 2002
Where is "for"? Is it Scanning ... goto Scanning?
Also, the code is distorted. Don't use Quote. Just copy using menu Edit -> Other Formats -> Copy BBCode and simply paste here.
Posts: 12,073
Threads: 140
Joined: Dec 2002
What does key Ce? On my computer it shows or hides Search pane.
Posts: 15
Threads: 3
Joined: Sep 2006
Yes. The loop is the Scanning... goto Scanning.
And about de Ce, means Control+E (select all). I can't use the implicit function in QM, because the results aren't as I expected (joins the content of the cells).
I have corrected the code below. I doesn't know this function on QM :oops: Sorry!
Posts: 12,073
Threads: 140
Joined: Dec 2002
Does memory usage drops when macro ends?
Posts: 15
Threads: 3
Joined: Sep 2006
I have tested it now.
The memory remains used until I rerun the same macro (if it's another different macro, the memory isn't freed
Posts: 12,073
Threads: 140
Joined: Dec 2002
Memory leaks in htm while waiting. I'll try to fix this, if possible.
Avoid using htm with wait time. Instead use wait.
OI.Click
wait 180 "window name" ;;or wait 180 I
0.1
OI=htm("TD" _s "" win(" Internet Explorer" "IEFrame") "1/2" 11 0x21)
Another problem - iexplore.exe memory usage also grows, and almost 2 times faster than qm.exe. It also grows if using only keyboard and mouse. If it is problem, restart IE every n times.
I could not test with your macro because it needs particular web page, etc. Instead I used this code:
out
rep() clo "Internet Explorer"; err break
web "http://www.google.com/advanced_search?hl=en" 9
int ie=win("Microsoft Internet Explorer")
Htm el
int i
for i 0 5000
,el=htm("INPUT" "as_q" "" ie 0 0 0x221 30)
,el.SetText("egubotiretfa")
,el=htm("INPUT" "as_epq" "" ie 0 3 0x221)
,el.SetText("kkksshhgshags")
,el=htm("INPUT" "as_oq" "" ie 0 4 0x221)
,el.SetText("eersttaatta")
,el=htm("INPUT" "as_eq" "" ie 0 5 0x221)
,el.SetText("lljshajha")
,el=htm("INPUT" "Google Search" "" ie 0 2 0x421)
,el.Click
,el=htm("A" "Advanced Search" "" ie 0 13 0x21 30)
,el.Click
,out i
While it runs, QM memory usage grows. Adds about 15 MB after 500 times. But this code does not add memory:
out
rep() clo "Internet Explorer"; err break
web "http://www.google.com/advanced_search?hl=en" 9
int ie=win("Microsoft Internet Explorer")
1
Htm el
int i
for i 0 5000
,el=htm("INPUT" "as_q" "" ie 0 0 0x221)
,el.SetText("egubotiretfa")
,el=htm("INPUT" "as_epq" "" ie 0 3 0x221)
,el.SetText("kkksshhgshags")
,el=htm("INPUT" "as_oq" "" ie 0 4 0x221)
,el.SetText("eersttaatta")
,el=htm("INPUT" "as_eq" "" ie 0 5 0x221)
,el.SetText("lljshajha")
,el=htm("INPUT" "Google Search" "" ie 0 2 0x421)
,el.Click
,wait 0 "egu"
,0.1
,el=htm("A" "Advanced Search" "" ie 0 13 0x21)
,el.Click
,wait 0 "Google Advanced Search"
,0.1
,
,out i
Posts: 15
Threads: 3
Joined: Sep 2006
Oks. Thanks for your help. Now I will try something....
Your help was very useful, but I can't do the "wait", because the loop will need the double time (from 5 or 6 hours to.... more of 10 or so :? (the web where I apply the code is very bad.
When I try what I have thinked, I post it.
EDITED: It's too late. I'll try it tomorrow. Bye!
|