From owner-freebsd-hackers Thu Sep 23 2:18:52 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id E88F4154E9 for ; Thu, 23 Sep 1999 02:18:47 -0700 (PDT) (envelope-from bright@wintelcom.net) Received: from localhost (bright@localhost) by fw.wintelcom.net (8.9.3/8.9.3) with ESMTP id CAA13375; Thu, 23 Sep 1999 02:35:19 -0700 (PDT) Date: Thu, 23 Sep 1999 02:35:19 -0700 (PDT) From: Alfred Perlstein To: Matthew Dillon Cc: Kevin Day , "Daniel C. Sobral" , hackers@FreeBSD.ORG Subject: Re: Idea: disposable memory In-Reply-To: <199909230904.CAA23644@apollo.backplane.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 23 Sep 1999, Matthew Dillon wrote: > > :> > Thoughts? > :> > :> man madvise? > :> > : > :Yeah, but MADV_FREE doesn't really do what I need. I have no idea if the > :system actually did free my ram or not. I want to hang on to the data, but > :if more ram is needed, then it can be discarded, but I need to know that it > :did, so that I can recreate it. Checking every time I blit an object to see > :if the page is zero'ed won't work. > : > :Kevin > > madvise ... MADV_DONTNEED is what you want. The data will remain mapped > until the system reuses it, at which point it reverts to zero-fill. Don't you mean MADV_FREE? -Alfred > > The system will reuse the data fairly quickly, even if the system is > not all that loaded. > > You can lock the page back in simply by writing to something in the page. > > The system implements this madvise feature by marking the pages clean. > If you happen to write to the page before the system reuses it, it of > course gets redirtied. If you don't and the system reuses the page, > it goes bye bye (turns into zero-fill) from the point of view of your > process. > > -Matt > Matthew Dillon > > > > > 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