From owner-freebsd-current@FreeBSD.ORG Wed Dec 24 08:04:10 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CD4D216A4CE for ; Wed, 24 Dec 2003 08:04:10 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id F387743D1F for ; Wed, 24 Dec 2003 08:04:04 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.10/8.12.10) id hBOG44Pf094725 for freebsd-current@freebsd.org; Wed, 24 Dec 2003 10:04:04 -0600 (CST) (envelope-from dan) Date: Wed, 24 Dec 2003 10:04:04 -0600 From: Dan Nelson To: freebsd-current@freebsd.org Message-ID: <20031224160404.GG2890@dan.emsphone.com> References: <21370.1071952691@critter.freebsd.dk> <20031224154121.GA83770@e-Gitt.NET> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031224154121.GA83770@e-Gitt.NET> X-OS: FreeBSD 5.2-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.5.1i Subject: Re: file descriptor leak in 5.2-RC X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Dec 2003 16:04:10 -0000 In the last episode (Dec 24), Oliver Brandmueller said: > I just started (by accident) a new thread regarding the same topic... > On Sat, Dec 20, 2003 at 09:38:11PM +0100, Poul-Henning Kamp wrote: > > In message , Robe > > rt Watson writes: > > > > >[...] so if we actually have a leak, > > >fstat(8) should show a small number of files, but the sysctl > > >kern.openfiles should reveal a large number of files open. > > > > sysctl kern.malloc | grep "file desc" ? > > I can with no problems reproduce this behaviour. > > The machine is a mail filtering server running exim, amavisd + > SpamAssassin and ClamAV. I do have the machine currently in a testing > environment and thus can do some experimentation. > > The machine gets the whole feed of messages we usually have (but just > not delivers any mail back to the main servers after filtering). This > means about 3-5 Mails per second going through the machine, which > seems enough to reproduce the effect very fast. > > The following values are (with SCHED_4BSD, SCHED-ULE give the same) > read in single user mode after the machine had been up for about 25 > minutes and did 10 minutes of mail filtering. Of course none of the > daemons are running anymore: > > # sysctl kern.openfiles > kern.openfiles: 4715 > # lsof | wc -l > 35 > # fstat | wc -l > 23 pstat -f might help here; it should list the raw contents of the file table. Then again, fstat should too :) . Interesting columns would be TYPE and CNT. If you're good with gdb -k, LOC/DATA might let you figure out the filename/socket details. -- Dan Nelson dnelson@allantgroup.com