> This is my example of pthread not releasing memory resources when the thread
> function exits (I would REALLY like to have that memory back).
> I have written (copied and modified...) a small program that creates 200
> threads which exit after 10 seconds.
> The main function then sleeps for 20 seconds, allowing me/you to ps aux |
> grep <progname> to see the big vsize increase.
> You can clearly see (below the source) that even though the functions exit,
> memory is not released. Both the vsize and the rss stay the same.

I didn't look at the details, but I think this is not a bug.  Most
implementations of malloc/free will not return free()d memory to the OS, but
instead they will keep it, and just mark it internally as free. the next
time a user wants to malloc more memory, he will get the same that was
marked free before. So normally programs never shrink. (unless they actually
return memory to the kernel using a real system call, such as brk..)





=================================================================
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