Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Sep 1999 02:35:19 -0700 (PDT)
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        Kevin Day <toasty@dragondata.com>, "Daniel C. Sobral" <dcs@newsguy.com>, hackers@FreeBSD.ORG
Subject:   Re: Idea: disposable memory
Message-ID:  <Pine.BSF.4.05.9909230233570.6368-100000@fw.wintelcom.net>
In-Reply-To: <199909230904.CAA23644@apollo.backplane.com>

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

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 
> 					<dillon@backplane.com>
> 
> 
> 
> 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.05.9909230233570.6368-100000>