Date: Tue, 31 Dec 2002 08:29:48 -0700 (MST) From: "Joe R.Doupnik" <jrd@netlab1.usu.edu> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/46653: rpc.statd is a v. memory hog, needlessly Message-ID: <20021231152948.DECF7AB89@netlab1.usu.edu>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021231152948.DECF7AB89>
