Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Oct 2001 12:23:12 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Dwayne.MacKinnon@xwave.com
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Memory allocation question
Message-ID:  <3BBB65A0.65FE804B@mindspring.com>
References:  <3BBA29C0.5E125DAF@xwave.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Dwayne wrote:
>      I'm creating an app where I want to use memory to store data so I
> can get at it quickly. The problem is, I can't afford the delays that
> would occur if the memory gets swapped out. Is there any way in FreeBSD
> to allocate memory so that the VM system won't swap it out?

Allocate it at boot time in machdep.c; that's one way, but
that's mostly for use in the kernel (though you could set
the PG_U bit on the pages, which would double map them in
both the kernel and all user space processes.

Another way is to put it in a System V shared memory segment,
and set the sysctl option that wires it down.

Have you read the madvise() man page?

-- Terry

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?3BBB65A0.65FE804B>