Sign in to follow this  
Followers 0
condor

handle/memory leak with Run/StdoutRead

2 posts in this topic

hi!

autoit doesn't close the pipe-handles and thus causes the system to eat up the memory. did i missed a function to close these handles? ~ StdClose($pid)?

tested with autoit 3.2.2.0 and 3.2.4.9 on xpsp2. open task manager, view, select 'handles', launch the script and watch the handle-counter going up and after a few hours the system will rant about "no resources available".

Opt("MustDeclareVars", 1)
while 1
    query()
    sleep(500)
Wend

Func query()
    local $pid, $output

    TraySetToolTip(@AutoItPID & " " & @ScriptName &  " " & @SEC);-- so we can see that it's still active
    $pid = Run(EnvGet("COMSPEC") & " /c echo hello world","",@SW_HIDE,2);$STDOUT_CHILD
    ProcessWaitClose($pid)
    $output = StdoutRead($pid)
EndFunc

best regards, condor

Share this post


Link to post
Share on other sites



hi!

autoit doesn't close the pipe-handles and thus causes the system to eat up the memory. did i missed a function to close these handles? ~ StdClose($pid)?

tested with autoit 3.2.2.0 and 3.2.4.9 on xpsp2. open task manager, view, select 'handles', launch the script and watch the handle-counter going up and after a few hours the system will rant about "no resources available".

Opt("MustDeclareVars", 1)
while 1
    query()
    sleep(500)
Wend

Func query()
    local $pid, $output

    TraySetToolTip(@AutoItPID & " " & @ScriptName &  " " & @SEC);-- so we can see that it's still active
    $pid = Run(EnvGet("COMSPEC") & " /c echo hello world","",@SW_HIDE,2);$STDOUT_CHILD
    ProcessWaitClose($pid)
    $output = StdoutRead($pid)
EndFunc

best regards, condor

You should post this in the bugs section for the post to get some attention I would think?

http://www.autoitscript.com/forum/index.php?showforum=3

See ya

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0