Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Nov 2001 15:09:39 -0500
From:      "Jason Mawdsley" <jason@macadamian.com>
To:        "mark tinguely" <tinguely@web.cs.ndsu.nodak.edu>, <bright@mu.org>
Cc:        <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: mmap/madvise
Message-ID:  <02ae01c16891$4c1f4970$2a64a8c0@macadamian.com>
References:  <200111081947.fA8JlAe03457@web.cs.ndsu.nodak.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
> Jason Mawdsley <jason@macadamian.com> asks:
>
> >  > I am looking for a way to reserve memory, without actually allocating
the
> >  > swap space.
>
> Alfred Perlstein answers:
>
> >  Just proceed normally, freebsd does overcommit such that you really
> >  don't need to do anything special to get the results you desire.
>
> I assume Jason is writting a userland application, but I cannot tell
> how he was using the allocated memory. Alfred is correct in that
> allocated memory is not even physical until needed and only paged back
> if modified AND space becomes low.
>
> Without information of what he was doing, I was trying to read between
> the lines of his message and wonder if he needs the memory physically
> there and wired (using mprotect) to prevent the memory from being
released.

I am creating a virtual memory manager.

Currently I am doing a
mmap(...PROT_NONE, MAP_ANON ) to reserve the memory.
then when committing the memory I am using mprotect( ...PROT_READ |
PROT_WRITE )

HTH

Jason Mawdsley ~ jason@macadamian.com
m_ a c a d a m i a n    t e c h n o l o g i e s

"Software developers for the world's leading technology companies."
http://www.macadamian.com








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?02ae01c16891$4c1f4970$2a64a8c0>