LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 08-08-2011, 04:55 AM   #1
manikumar086
LQ Newbie
 
Registered: Jul 2011
Posts: 15

Rep: Reputation: Disabled
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...?
 
Old 08-08-2011, 02:51 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 1,773

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by manikumar086 View Post
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/
 
Old 08-09-2011, 12:46 AM   #3
manikumar086
LQ Newbie
 
Registered: Jul 2011
Posts: 15

Original Poster
Rep: Reputation: Disabled
Clearing of memory allocated by using malloc/kmalloc/vmalloc

Thank you SMALLPOND...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Where does the Kmalloc/Vmalloc/get_free_pages/malloc Allocates memory? manikumar086 Linux - Newbie 6 07-30-2011 02:34 PM
vmalloc or kmalloc for 16k memory space lorizhuang Linux - Kernel 3 06-14-2011 03:26 PM
Memory leaks.. *** glibc detected *** ./SuffixTree: malloc(): memory corruption: 0x00 evansash Programming 12 03-21-2011 02:17 PM
[SOLVED] Find Physical address of memory provided by kmalloc raghu2383 Programming 3 10-23-2009 03:25 PM
[SOLVED] Memory leak: How risky not to free allocated memory. kaz2100 Linux - General 1 12-24-2008 01:00 AM


All times are GMT -5. The time now is 08:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration