From owner-freebsd-arch Fri Jan 10 18:15: 5 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 51A4737B401 for ; Fri, 10 Jan 2003 18:15:04 -0800 (PST) Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 463ED43F65 for ; Fri, 10 Jan 2003 18:15:03 -0800 (PST) (envelope-from archie@dellroad.org) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id SAA91920 for ; Fri, 10 Jan 2003 18:01:09 -0800 (PST) Received: from arch20m.dellroad.org (localhost [127.0.0.1]) by arch20m.dellroad.org (8.12.6/8.12.6) with ESMTP id h0B20sHg024726 for ; Fri, 10 Jan 2003 18:00:54 -0800 (PST) (envelope-from archie@arch20m.dellroad.org) Received: (from archie@localhost) by arch20m.dellroad.org (8.12.6/8.12.6/Submit) id h0B20rUC024725 for freebsd-arch@freebsd.org; Fri, 10 Jan 2003 18:00:53 -0800 (PST) From: Archie Cobbs Message-Id: <200301110200.h0B20rUC024725@arch20m.dellroad.org> Subject: Virtual memory question To: freebsd-arch@freebsd.org Date: Fri, 10 Jan 2003 18:00:53 -0800 (PST) X-Mailer: ELM [version 2.4ME+ PL99b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII 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 Dear freebsd-arch, Hope it's OK to ask a simple question here, it wasn't clear where else would be the right place to ask. 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? I'm working on a memory allocator that would allocate say a few pages at a time, using mmap() (instead of sbrk()). So over time a process may end up with hundreds or even thousands of short, mmap()'d regions of memory. Is this going to cause any weird problems or slowness? BTW this idea was spawned by this text in the sbrk(3) man page: The brk() and sbrk() functions are legacy interfaces from before the advent of modern virtual memory management. Along those lines, why does our malloc(3) library use sbrk(3) instead of mmap(), which would enable returning free pages back to the system more readily (since the pages would not have to be contiguous)? Thanks, -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message