AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Run function has a memory leak

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
silkcom



Joined: 23 Jan 2008
Posts: 96

PostPosted: Thu Jul 03, 2008 3:26 pm    Post subject: Run function has a memory leak Reply with quote

Does anyone know why the Run function uses up so much ram?

My script starts at 2 meg, I run a program, and it jumps to 6. I run another, and it's 8, then 9, etc. Not always the same, but it never clears that memory out. It seems to max out somewhere around 9 or 10.

any ideas?
Back to top
View user's profile Send private message
Red Hat Boy



Joined: 10 Apr 2008
Posts: 113

PostPosted: Thu Jul 03, 2008 7:42 pm    Post subject: Reply with quote

I notice that when I use the run command, it does jump up, but only slightly. My script starts at around 2200k and never goes higher than around 2800k. Are you using an older version?
_________________
I slit the sheet, the sheet I slit,
and on the slitted sheet I sit. ;~}
Back to top
View user's profile Send private message Send e-mail
ahklerner



Joined: 26 Jun 2006
Posts: 1205
Location: USA

PostPosted: Thu Jul 03, 2008 7:50 pm    Post subject: Reply with quote

Red Hat Boy wrote:
Despite popular belief, I am not high.

That's some funny shite there.
_________________
Back to top
View user's profile Send private message
silkcom



Joined: 23 Jan 2008
Posts: 96

PostPosted: Thu Jul 03, 2008 7:54 pm    Post subject: Reply with quote

I might be, 1.0.47 or something like that
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 5890

PostPosted: Thu Jul 03, 2008 7:56 pm    Post subject: Re: Run function has a memory leak Reply with quote

silkcom wrote:
Does anyone know why the Run function uses up so much ram?
My script starts at 2 meg, I run a program, and it jumps to 6. I run another, and it's 8, then 9, etc.


How do you see the memory usage ? With Windows Task Manager ?
If your are so concerned about it, call EmptyMem() after the Run command.

Code:
EmptyMem(PID="AHK Rocks"){
; Heresy : http://www.autohotkey.com/forum/viewtopic.php?t=32876
    pid:=(pid="AHK Rocks") ? DllCall("GetCurrentProcessId") : pid
    h:=DllCall("OpenProcess", "UInt", 0x001F0FFF, "Int", 0, "Int", pid)
    DllCall("SetProcessWorkingSetSize", "UInt", h, "Int", -1, "Int", -1)
    DllCall("CloseHandle", "Int", h)
}


Quote:
Not always the same, but it never clears that memory out. It seems to max out somewhere around 9 or 10.


I have seen one my of AHK script use over 600MB.. and Windows resets it before the physical memory id exhausted..

Smile
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
silkcom



Joined: 23 Jan 2008
Posts: 96

PostPosted: Thu Jul 03, 2008 8:47 pm    Post subject: Reply with quote

Can you explain what this is doing?
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 5890

PostPosted: Thu Jul 03, 2008 8:59 pm    Post subject: Reply with quote

silkcom wrote:
Can you explain what this is doing?


No! Shocked .. but maybe you could understand from the conversation between Heresy & Sean


Smile
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
silkcom



Joined: 23 Jan 2008
Posts: 96

PostPosted: Thu Jul 03, 2008 9:49 pm    Post subject: Reply with quote

Very excellent. I figured out what it was doing, just looked a little confusing at first.

This is wonderful, keeps my script at about 600k memory, and drops it back to that everytime i use the run command.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group