Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Jan 2003 08:35:28 +0100
From:      phk@freebsd.org
To:        Archie Cobbs <archie@dellroad.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: Virtual memory question 
Message-ID:  <3788.1042270528@critter.freebsd.dk>
In-Reply-To: Your message of "Fri, 10 Jan 2003 18:00:53 PST." <200301110200.h0B20rUC024725@arch20m.dellroad.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
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
couldn't collapse all the individual allocations (ie: N lines in
/proc/$pid/map

Poul-Henning
>
>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
>

-- 
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3788.1042270528>