From owner-freebsd-questions@FreeBSD.ORG Tue Apr 22 05:32:35 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6FFE737B401 for ; Tue, 22 Apr 2003 05:32:35 -0700 (PDT) Received: from pa-plum1b-166.pit.adelphia.net (pa-plum1b-122.pit.adelphia.net [24.53.161.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4239243FE1 for ; Tue, 22 Apr 2003 05:32:34 -0700 (PDT) (envelope-from wmoran@potentialtech.com) Received: from potentialtech.com (working [172.16.0.95]) h3MCWXwl002766; Tue, 22 Apr 2003 08:32:33 -0400 (EDT) (envelope-from wmoran@potentialtech.com) Message-ID: <3EA53661.6010007@potentialtech.com> Date: Tue, 22 Apr 2003 08:32:33 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.2.1) Gecko/20030301 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Adam References: <20030422004530.CAAB.BLUEESKIMO@gmx.net> In-Reply-To: <20030422004530.CAAB.BLUEESKIMO@gmx.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: Strange networking behaviour (memory leak?) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2003 12:32:35 -0000 Adam wrote: > I've recently become very concious of possible memory leaks on my > FreeBSD box. While troubleshooting a particular memory leak, I came > across some very peculiar behaviour when copying files over the local > 100mbit network. > > When copying files over the network, the free memory on my FreeBSD box > drops at a rate of about 30mb every couple seconds. It eventually > bottoms out at about 500k free. > > If I kill the active transfer, the amount of free RAM is not affected. > However, if I delete the file that was being written to the FreeBSD box, > the free RAM instantaneously increases by about 400-450mb. Note that > this has only been tested on transfers of large files (>600mb). > > I've tested this behaviour both by downloading from my Windows computer > to the FreeBSD box (using lftp on FreeBSD), and by uploading from the > Windows computer to the FreeBSD machine via PureFTPd (SFTP behaves > similarly, but much slower since I get max 165k/s via SFTP). > > Is this behaviour expected? Is it normal? Yes and yes. I assume that you're looking at the output of top while you're doing this. FreeBSD is pretty smart about memory. In the top display you see active, inactive, cache, buffer, wired, and free memory. The memory that's actually free is really the sum of inactive, buffer, cache, and free. The free memory is free immediately, those other three can become free with very, very little effort on the part of the kernel, but if you call up the same application again and it's still in inactive memory, it'll start up quicker than if it has to reload it from disk. Free memory is wasted memory. -- Bill Moran Potential Technologies http://www.potentialtech.com