From owner-freebsd-arch Sat Jan 11 3:46:21 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 930F737B401 for ; Sat, 11 Jan 2003 03:46:20 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id C3C1343E4A for ; Sat, 11 Jan 2003 03:46:19 -0800 (PST) (envelope-from phk@freebsd.org) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.6/8.12.6) with ESMTP id h0BBk0Ft005171; Sat, 11 Jan 2003 12:46:02 +0100 (CET) (envelope-from phk@freebsd.org) To: David Schultz Cc: Archie Cobbs , freebsd-arch@freebsd.org Subject: Re: Virtual memory question From: phk@freebsd.org In-Reply-To: Your message of "Sat, 11 Jan 2003 03:35:51 PST." <20030111113551.GC3961@HAL9000.homeunix.com> Date: Sat, 11 Jan 2003 12:46:00 +0100 Message-ID: <5170.1042285560@critter.freebsd.dk> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <20030111113551.GC3961@HAL9000.homeunix.com>, David Schultz writes: >Thus spake phk@FreeBSD.ORG : >> In message <200301110200.h0B20rUC024725@arch20m.dellroad.org>, Archie Cobbs wri >> tes: >> >> >The question is: how does the performance of various FreeBSD system >> >calls (especially mmap() and munmap()) degrade when a process has >> >lots and lots of tiny regions mapped into memory? >> >> Badly. At least it used to do: When I wrote phkmalloc(3) I tried >> using malloc instead of sbrk(2) and it suffered because the VM system > ^^^^^^ you mean mmap(2)? >> couldn't collapse all the individual allocations (ie: N lines in >> /proc/$pid/map > >The following program does 1000 mmaps of various sizes, then >prints its own memory map. It shows that the resulting vm_map has >only a few entries in both -CURRENT and -STABLE. The log for >src/sys/vm/vm_map.c suggests that the collapse code may have been >broken/non-optimal at several times during the past six years. Could be, I have not revisited the issue since 1995 or so. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message