From owner-freebsd-stable@FreeBSD.ORG Fri Jan 21 12:06:55 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA63F16A4CE for ; Fri, 21 Jan 2005 12:06:55 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8219A43D41 for ; Fri, 21 Jan 2005 12:06:55 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.13.1/8.13.1) with ESMTP id j0LC6f4H007616; Fri, 21 Jan 2005 07:06:41 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)j0LC6fm1007613; Fri, 21 Jan 2005 12:06:41 GMT (envelope-from robert@fledge.watson.org) Date: Fri, 21 Jan 2005 12:06:41 +0000 (GMT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Phillip Salzman In-Reply-To: <00b001c4fea0$7533d490$6745a8c0@MESE> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: stable@freebsd.org Subject: Re: Very large directory X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2005 12:06:56 -0000 On Wed, 19 Jan 2005, Phillip Salzman wrote: > I have a pair of servers that act as SMTP/AV gateways. It seems that > even though we've told the AV software not to store messages, it is > anyway. > > They've been running for a little while now - and recently we've noticed > a lot of disk space disappearing. Shortly after that, a simple du into > our /var/spool returned a not so nice error: > > du: fts_read: Cannot allocate memory > > No matter what command I run on that directory, I just don't seem to > have enough available resources to show the files let alone delete them > (echo *, ls, find, rm -rf, etc.) > > I'm hoping someone else here might have a suggestion as to what I can do > to fix this. fts(3) is quite memory intensive--more though than strictly necessary for the functionality required by du(1). du is running into an administrative memory resource limit. Depending on the shell and login.conf configuration you're using, you may need to use the limits(1) command, limit(1), or tweak the user's class settings. I run into this on my boxes with 1,000,000 files or so in a directory, or with large directory trees (i.e., 7,000,000 files). Robert N M Watson