From: newsham AT lava DOT net (Tim Newsham) Subject: spawn memory leak? 4 Jun 1998 15:13:51 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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.