From owner-freebsd-questions@FreeBSD.ORG Sun Mar 15 12:48:45 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 510381065677 for ; Sun, 15 Mar 2009 12:48:45 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (wojtek.tensor.gdynia.pl [IPv6:2001:4070:101:2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 67F138FC13 for ; Sun, 15 Mar 2009 12:48:43 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (localhost [IPv6:::1]) by wojtek.tensor.gdynia.pl (8.14.3/8.14.3) with ESMTP id n2FCmAqI041544; Sun, 15 Mar 2009 13:48:10 +0100 (CET) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from localhost (wojtek@localhost) by wojtek.tensor.gdynia.pl (8.14.3/8.14.3/Submit) with ESMTP id n2FCm931041541; Sun, 15 Mar 2009 13:48:10 +0100 (CET) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Date: Sun, 15 Mar 2009 13:48:09 +0100 (CET) From: Wojciech Puchar To: cpghost In-Reply-To: <20090315105206.GB1282@phenom.cordula.ws> Message-ID: References: <20090315091301.GB1051@phenom.cordula.ws> <20090315100141.GA1282@phenom.cordula.ws> <20090315105206.GB1282@phenom.cordula.ws> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-questions@freebsd.org Subject: Re: Speeding up exit(2)? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Mar 2009 12:48:45 -0000 >> it swapped a lot, then wrote "end" and immediately exited. > > Hmmm... yes, it's strange. With malloc-ed space, exit is also very > fast. On a 2 GB machine with amd64, exit is almost immediate: try mallocing 2 million times 2 kilobytes and fill. maybe exit first free all malloc'ed space which is definitely nonsense. > > If I find a way to isolate the problem, I'll post it here. maybe your problematic program uses atexit and exit actually calls part of it?