Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


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

Detecting Memory Leaks -- the right solution



On Fri, 16 Jul 2004 09:03:37 -0400
"Jules Gilbert" <julesg at newebmail.com> wrote:

> ('free' NEVER returns memory
> to the OS!), 
This is not true. While I do not know if this is true on Linux, I do
know at least one Unix where free(2) would return memory back if the
conditions were right:
The most recently sbrk'd page on the allocated heap is available and
free has coalesced them into a single block. This is a function of the
malloc/free algorithms in use as well as the user's allocation scheme.
Also, some library functions also call malloc(3), and C++ is dirtier in
this context. Not only must a C++ user be very conscientious in the use
of destructors, but some C++ library functions and templates might also
contribute to memory leaks. 
-- 
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.blu.org/pipermail/discuss/attachments/20040716/a474a780/attachment.sig>



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org