LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Clearing of memory allocated by using malloc/kmalloc/vmalloc (http://www.linuxquestions.org/questions/linux-newbie-8/clearing-of-memory-allocated-by-using-malloc-kmalloc-vmalloc-896147/)

manikumar086 08-08-2011 03:55 AM

Clearing of memory allocated by using malloc/kmalloc/vmalloc
 
Hi,

Let's analyse this While registering a Char deriver to kernel think that we had allocated memory using any of malloc/kmalloc/vmalloc.

If we forgot to Free that allocated memory while unregistering, will that memory be allocated aside or kernel clears it...?

smallpond 08-08-2011 01:51 PM

Quote:

Originally Posted by manikumar086 (Post 4436586)
Hi,

Let's analyse this While registering a Char deriver to kernel think that we had allocated memory using any of malloc/kmalloc/vmalloc.

If we forgot to Free that allocated memory while unregistering, will that memory be allocated aside or kernel clears it...?

Any memory not freed at exit is lost -- its a memory leak. See ch. 2 of LDD
http://lwn.net/Kernel/LDD3/

manikumar086 08-08-2011 11:46 PM

Clearing of memory allocated by using malloc/kmalloc/vmalloc
 
Thank you SMALLPOND...


All times are GMT -5. The time now is 10:57 PM.