[Tfug] Malloc under Linux

Terence Rudkin trudkin at gmail.com
Wed Feb 6 06:06:42 MST 2008


Maybe the question should be,
Does the free release memory when the program exits or when free is called?

malloc allocates when called.  free marks for removal when called but
the OS may not reclaim until the allocate memory at the point.   the
scope in which memory is allocated plays a role in when and how the OS
will report the freed memory.

HAve more details on  a test case?

TR

On Feb 6, 2008 4:24 AM, Felix Tilley <fetilley at earthlink.net> wrote:
> When you use the malloc function with Linux, is the memory space
> allocated when the program runs, or when the malloc function executes?
>
> I ask this because the free function does not appear to free any memory.
>
> Felix
>
>
>
> uname -a
> Linux linux 2.6.16.13-4-default #1 Wed May 3 04:53:23 UTC 2006 i686 i686
> i386 GNU/Linux
>
>
>
> _______________________________________________
> Tucson Free Unix Group - tfug at tfug.org
> Subscription Options:
> http://www.tfug.org/mailman/listinfo/tfug_tfug.org
>




More information about the tfug mailing list