From owner-freebsd-bugs Tue Dec 31 7:30: 6 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3A09937B405 for ; Tue, 31 Dec 2002 07:30:04 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37C7743EDC for ; Tue, 31 Dec 2002 07:30:03 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gBVFU3NS033100 for ; Tue, 31 Dec 2002 07:30:03 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gBVFU3DD033099; Tue, 31 Dec 2002 07:30:03 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 851AC37B401 for ; Tue, 31 Dec 2002 07:29:49 -0800 (PST) Received: from netlab1.usu.edu (netlab1.usu.edu [129.123.1.43]) by mx1.FreeBSD.org (Postfix) with ESMTP id 422E243ED1 for ; Tue, 31 Dec 2002 07:29:49 -0800 (PST) (envelope-from root@netlab1.usu.edu) Received: by netlab1.usu.edu (Postfix, from userid 0) id DECF7AB89; Tue, 31 Dec 2002 08:29:48 -0700 (MST) Message-Id: <20021231152948.DECF7AB89@netlab1.usu.edu> Date: Tue, 31 Dec 2002 08:29:48 -0700 (MST) From: "Joe R.Doupnik" Reply-To: "Joe R.Doupnik" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/46653: rpc.statd is a v. memory hog, needlessly Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 46653 >Category: bin >Synopsis: rpc.statd is a v. memory hog, needlessly >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Tue Dec 31 07:30:02 PST 2002 >Closed-Date: >Last-Modified: >Originator: Joe R. Doupnik >Release: FreeBSD 4.7-RELEASE i386 >Organization: Utah State University >Environment: System: FreeBSD netlab1.usu.edu 4.7-RELEASE FreeBSD 4.7-RELEASE #11: Tue Dec 17 16:14:38 MST 2002 root@netlab1.usu.edu:/usr/src/sys/compile/JRD i386 >Description: Utility rpc.statd shows itself as consuming 256MB of virtual memory. Digging into its sources reveals it does an nmap of this amount to hold a simple file of contactable sites. This is absurd. I reduced the nmap size to a rational amount. FreeBSD 4.7-RELEASE. Excerpt from /usr/src/sbin.usr/rpc.statd/file.c is included, with my one line change. Joe Doupnik jrd@netlab1.usu.edu >How-To-Repeat: >Fix: Excerpt from file.c /* File now open. mmap() it, with a generous size to allow for */ /* later growth, where we will extend the file but not re-map it. */ status_info = (FileLayout *) mmap(NULL, 0x1000, PROT_READ | PROT_WRITE, MAP_SHARED, status_fd, 0); /*JRD was 256MB! mmap(NULL, 0x10000000, PROT_READ | PROT_WRITE, MAP_SHARED, s tatus_fd, 0); */ if (status_info == (FileLayout *) MAP_FAILED) warn("unable to mmap() status file"); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message