X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 	tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
From: Haojun Bao <baohaojun@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Emacs can't start-process more than 30~40 processes
References: <83iqhlbgoc.fsf@gmail.com> <4A6727A8.2090905@cornell.edu> 	<83iqhkur2h.fsf@gmail.com> <834osy98jo.fsf_-_@gmail.com> 	<83tz0xtt6c.fsf@gmail.com> <20090729023256.GC11458@ednor.casa.cgf.cx> 	<838wi8vt9v.fsf@gmail.com> <20090729232522.GC13645@ednor.casa.cgf.cx>
Date: Thu, 30 Jul 2009 09:19:03 +0800
In-Reply-To: <20090729232522.GC13645@ednor.casa.cgf.cx> (Christopher Faylor's 	message of "Wed, 29 Jul 2009 19:25:22 -0400")
Message-ID: <83y6q70xyw.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.96 (cygwin)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com> writes:

> On Wed, Jul 29, 2009 at 03:32:28PM +0800, Haojun Bao wrote:
>>>
>>> Not necessarily.  We don't expect these functions to return NULL.  It
>>> would be interesting to know how many fds are open at this point.  If it
>>> is a large number then maybe we have to start enforcing an fd max.  If
>>> it is a "small" number then something is wrong and we're allocating too
>>> much of the cygheap.  The cygheap was always supposed to be relatively
>>> small.  Maybe we're abusing it too much in 1.7.
>>
>>There are quite some fds. In start-process, emacs will allocate 1 PTY
>>and 1 pipe for each process it starts.
>
> Yes, I assumed that there were a bunch of fds but I was looking for an
> exact number rather than "quite some".  I can't give exact details about
> how to find the number now but I thought that since you were looking at
> the code it wouldn't be too hard to figure this value out.
>

Sorry. There are a total of 40 fds in one test run from
/proc/PID/fd. Seems the PTYs and pipes are allocated and released soon,
what remains are /dev/ptmx fds.

    $'ls' -l /proc/5668/fd 
    total 0
    lrwxrwxrwx 1 bhj None 0 2006-12-01 08:00 0 -> /dev/tty2
    lrwxrwxrwx 1 bhj None 0 2006-12-01 08:00 1 -> /dev/tty2
    lrwxrwxrwx 1 bhj None 0 2006-12-01 08:00 2 -> /dev/tty2
    lrwxrwxrwx 1 bhj None 0 2006-12-01 08:00 37 -> /dev/tty36
    lrwxrwxrwx 1 bhj None 0 2006-12-01 08:00 38 -> pipe:[2180]|
    lrwxrwxrwx 1 bhj None 0 2006-12-01 08:00 39 -> pipe:[2232]|
    ...
    #bhj: fd 3-36 are all opened -> /dev/ptmx
    ...
    

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

