Date: Wed, 10 Oct 2001 19:16:46 +0400 (MSD) From: "Andrew L. Neporada" <andrew@nas.dgap.mipt.ru> To: Matt Dillon <dillon@earth.backplane.com> Cc: Maxime Henrion <mux@qualys.com>, Dwayne <Dwayne.MacKinnon@xwave.com>, freebsd-hackers@FreeBSD.ORG Subject: Re: Memory allocation question Message-ID: <Pine.BSF.4.21.0110101914280.51319-100000@nas.dgap.mipt.ru> In-Reply-To: <200110030552.f935q5j63360@earth.backplane.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2 Oct 2001, Matt Dillon wrote: > > : > :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? > :> > :I think mlock(2) is what you want. > : > :Maxime Henrion > :-- > :Don't be fooled by cheap finnish imitations ; BSD is the One True Code > > Don't use mlock(). Could you please explain that. Thanks. > > Use SysV Shared memory segments. If you tell the kernel to use > physical ram for SysV shared memory (kern.ipc.shm_use_phys=1) > then any shm segments you allocate (see manual pages for > shmctl, shmget, and shmat) will reside in unswappable shared memory. > > -Matt > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > 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?Pine.BSF.4.21.0110101914280.51319-100000>