* Baruch Even <[EMAIL PROTECTED]> [061003 12:16]: > * Michael Sternberg <[EMAIL PROTECTED]> [061003 09:21]: > > From man page of "free" on Solaris 8: > > > > The argument to free() is a pointer to a block previously > > allocated by malloc(), calloc(), or realloc(). After free() > > is executed, this space is made available for further allo- > > cation by the application, though not returned to the sys- > > tem. Memory is returned to the system only upon termination > > of the application. > > > > Two questions: > > > > 1. What the situation in Linux ? Is "free" returns memory to OS ? > > 2. If not - what the proper call to "flush" memory back to OS ? > > The behaviour of free() depends on the libc that you use, a sane libc > will not return the memory to the OS except in special cases.
This contradicts what I wrote later on that glibc will return memory to the OS when possible. It happens when you research the details for the answer while you write it. Though I expect that in most usage cases memory will not be returned simply because it is impossible to do so. Baruch ================================================================= 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]
