Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Dec 2000 10:23:09 -0800 (PST)
From:      Matt Dillon <dillon@earth.backplane.com>
To:        Brooks Davis <brooks@one-eyed-alien.net>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: cvs commit: src/lib/libc/sys mmap.2
Message-ID:  <200012041823.eB4IN9g73689@earth.backplane.com>
References:  <200012032017.eB3KHaC61682@freefall.freebsd.org> <20001204094700.B546@Odin.AC.HMC.Edu>

next in thread | previous in thread | raw e-mail | index | archive | help

:
:I've got a (hopefully) quick question about this warning.  If I'm using
:mmap to create shared memory segments and I don't care about the
:contents of the file after the run does this fragmentation hurt me?  I'm
:asking because I've got code that uses up to 1.3GB of mmaped storage.
:The mmaped storage may be larger then physical memory at this point, but
:the portion I actually use should fit in RAM.
:
:Thanks,
:Brooks

    If you remove() the file after use then I don't think it will matter...
    the dirty pages will be thrown away when the last descriptor reference
    goes away and the file is removed.

    Certainly for small files (less then 20MB) it is entirely irrelevant.
    For lager files it may be a good idea to force creation of the backing
    store (by write()ing zero's) to avoid long crash/reboot times from
    the system trying to flush the dirty pages, and to avoid the situation
    where the filesystem runs out of space while trying to allocate backing
    store, which will seg-fault the process.

						-Matt



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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