[Haskell-cafe] memory usage in repeated reading of an external program's output

Andrea Rossato mailing_list at istitutocolli.org
Thu Jun 21 16:54:36 EDT 2007

On Thu, Jun 21, 2007 at 01:36:16PM -0700, Bryan O'Sullivan wrote:
>  Andrea Rossato wrote:
> > Still I do not understand you reference to the leak problem. Could you
> > please elaborate a bit?
>  The runProcess function returns a ProcessHandle.  If you don't call 
>  waitForProcess on that handle, you'll leak those handles.  On Unix-like 
>  systems, this means you'll accumulate zombie processes and potentially fill 
>  your process table, DoSing your machine.

ahhh, yes, I found out the hard way. By the way, in the code I'm
writing I was waiting for the exit code of the process. I forgot to
copy it in the first example, and when I run it...;-)

as you can see, the second version already corrected the problem.

Thanks for your kind attention.

All the best.

More information about the Haskell-Cafe mailing list