gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: testing malloc / free behaviour


From: David Ayers
Subject: Re: testing malloc / free behaviour
Date: Mon, 17 Dec 2007 10:42:51 +0100
User-agent: Mozilla Thunderbird 1.0.2 (X11/20070113)

David Wetzel schrieb:
> Hi,
> 
> just run this and a top in a different terminal. If the memory use of the 
> process goes down after the 
> "freeing..." message, all is fine.
> 
> It works as expected on Mac OS X Leopard and NetBSD 3.1
> 
> You might set your limits to unlimited before running this.


http://www.gnu.org/software/libc/manual/html_node/Freeing-after-Malloc.html#Freeing-after-Malloc
[http://tinyurl.com/yqh6n4]

"Occasionally, free can actually return memory to the operating system
and make the process smaller. Usually, all it can do is allow a later
call to malloc to reuse the space. In the meantime, the space remains in
your program as part of a free-list used internally by malloc.

There is no point in freeing blocks at the end of a program, because all
of the program's space is given back to the system when the process
terminates. "

Cheers,
David




reply via email to

[Prev in Thread] Current Thread [Next in Thread]