delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/06/04/15:13:51

From: newsham AT lava DOT net (Tim Newsham)
Subject: spawn memory leak?
4 Jun 1998 15:13:51 -0700 :
Message-ID: <m0yhhst-001185C.cygnus.cygwin32.developers@malasada.lava.net>
Mime-Version: 1.0
To: cygwin32-developers AT cygnus DOT com

I believe there is a memory leak in the spawn code somewhere.  So far
we haven't been able to track it down.  We wrote a test case that
builds an argv/envp with some extra garbage in it that invoked
a hello-world program repeatedly with spawnve and _P_NOWAIT.  We looped 
over the spawn with a sleep(1) in between.  Watching the VMSize and
MemUsage in the task manager showed the process was accumulating more
and more memory.  Replacing the spawnve with fork+exec code resulted
in a program that did not accumulate memory.  I can post test cases
we used if desired.

The only allocation I saw in the spawn functions themselves were
alloca calls which auto-free since they're on the stack (I ran tests
to verify alloca was working properly in the dll, too).  I didn't
go tracing through every called procedure yet.

Btw, what is linearize_fd_array for, and why does the spawn code
use it (while the fork code doesn't appear to)?


                                              Tim N.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019