LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 03: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, 01:51 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
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-08-2011, 11:46 PM   #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



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 01:34 PM
vmalloc or kmalloc for 16k memory space lorizhuang Linux - Kernel 3 06-14-2011 02:26 PM
Memory leaks.. *** glibc detected *** ./SuffixTree: malloc(): memory corruption: 0x00 evansash Programming 12 03-21-2011 01:17 PM
[SOLVED] Find Physical address of memory provided by kmalloc raghu2383 Programming 3 10-23-2009 02:25 PM
[SOLVED] Memory leak: How risky not to free allocated memory. kaz2100 Linux - General 1 12-24-2008 12:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:59 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
Open Source Consulting | Domain Registration