Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Mon, 19 Aug 2002 10:37:39 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Process exhaustion; please test Message-ID: <20020819143738.GA18311@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <3D609310 DOT 1020700 AT gmx DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D609310.1020700@gmx.net> User-Agent: Mutt/1.3.23.1i On Mon, Aug 19, 2002 at 02:41:20PM +0800, Nils wrote: >I've been having a problem running out of process IDs and wrote a small >C program to test if it happens on other systems. On my system I use >up 2000 PIDs in ~500-550 forks. This seems like a lot. Could others >run this and see if they see the same? Please drop me or the list a >line with how it runs on your machine. I think you're working under the assumption that pids increase monotically. They don't. The pid numbers are pretty much random. The first time I ran this program it terminated after one iteration since it just happened to have created a new process with a pid more than 2000 greater than the initial pid. Two problems with your test program: 1) it not passing an argument to exit() and 2) it is not waiting for any of the process it creates. That means that it is leaking resources as all of the processes are becoming zombies and staying around forever. Unfortunately cygwin doesn't currently show you all of the zombies in the ps output. cgf > process=0; > initprocess=fork(); > > /* drop out of parent */ > if (initprocess<=0) { exit(); } > endprocess=initprocess+2000; > printf("Starting process ID is %d; ending at %d.\n",initprocess, endprocess); > > /* while to prevent exhausting processes completely */ > while(process { > process=fork(); > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/