On Tue, Oct 03, 2006 at 08:18:46AM +0200, Michael Sternberg wrote:

> Two questions:
> 
> 1. What the situation in Linux ? Is "free" returns memory to OS ?

No. free() returns memory to the standard C library, which may or may
not then return it to the OS.

> 2. If not - what the proper call to "flush" memory back to OS ?

The OS will take care of this automatically via the usual paging
mechanisms. If you have a large chunk of memory that you're sure is
not going to be used, you can help the OS along by using
madvise(ptr, size, MADV_DONTNEED).

Cheers,
Muli

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to