On Aug 30, 2000, the greycells of Sarcar, Shourya (MED) expressed :

> could anyone give me some pointers / URLs on what causes memory leaks and
> how to debug/avoid them ?
>  

Well, to put it in simple terms, memory leak is the memory that has been
allocated, but cannot be used by the program or by the user.
It might happen if you malloc some memory do not free it and then malloc
again using the same pointer variable.
Essentially, this memory is lost.

Memory leak is critical if your program runs continuously, it may build up
and after some time you will be left with no free memory.

If you are a newbie, try using arrays instead of pointers, till you are
comfortable with malloc/free/realloc.

Also remember, "MEMORY THAT HAS BEEN ALLOCATED MUST BE FREED".

Hope I have been informative.

Regards,
Amar :)

-- 
$=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=$
My Home : http://www.crosswinds.net/~amargod
          http://amar.gnu-linux.net (for my Public Key)
$=-=-=-=-=-=-  L I N U X   R U L E S !  -=-=-=-=-=-=-=$

Your attitude in life always determines your altitude in life.



----------------------------------------------
The mailing list archives are available at
http://lists.linux-india.org/cgi-bin/wilma/LIH

Reply via email to