Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Jan 2003 16:28:53 -0600
From:      "Alan L. Cox" <alc@imimic.com>
To:        arch@freebsd.org
Subject:   Re: Virtual memory question
Message-ID:  <3E209AA5.ED387618@imimic.com>

next in thread | raw e-mail | index | archive | help
>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?

5.x is much, much better at handling this than 4.x.  That said, it's
time for a list of disclaimers.

1. Lookups are accelerated in 5.x, but finding the right amount of free
virtual address space isn't.  The free space hint often works well, but
can fail miserably.

2. Coalescing of mappings is complicated.  The program that was posted
here is a little too simplistic in its  "workload".  Specifically, it
never touches any of the memory and never munmaps any of the memory.  If
it did both, you would see fragmentation in the vm_map and situations
where you would say, "Gosh, why aren't these adjacent map entries
coalesced?"  The reason is that distinct anonymous memory objects got
allocated.  Currently, the only "work-around" is not to use anonymous
memory.  Create a "heap" file, use MAP_NOSYNC for performance, and make
sure that you pass the right file offset to mmap().

Regards,
Alan

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?3E209AA5.ED387618>