Re: Question on Memory Leaks in Module

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

 



>That means if I do kmalloc in a module and unload the module without kfree then that memory is lost and kernel wont be able to use that >memory in future. Right?
 
Oops! Apologies for repeating the question.
Yeah people already have said yes for this question in this thread.
 
Thanks
 
On 1/24/08, sahlot arvind <asahlot@xxxxxxxxx> wrote:
>And, memory allocated by pages are considered "kernel memory". So
>unless you mark them somehow, there is no difference between the ones
>allocated by module, syscall and so on.
 
Makes sense!
That means if I do kmalloc in a module and unload the module without kfree then that memory is lost and kernel wont be able to use that memory in future. Right?

 
On 1/24/08, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx > wrote:
Hi...
On Jan 24, 2008 1:32 PM, sahlot arvind < asahlot@xxxxxxxxx > wrote:
> Thanks to all for their resonse!
>
> Ok, just one thing -
> When I do lsmod -
> it shows the memory used by loaded LKMs. So if there is a leak in LKM1 then
> after executing the function (which is doing kmalloc but forgetting to do
> kfree) of LKM1, lsmod should report an increased memory usage by LKM1. Am I
> right?

I doubt it. I guess lsmod just show initialized+text size section, not
allocated pages during runtime of the module.

And, memory allocated by pages are considered "kernel memory". So
unless you mark them somehow, there is no difference between the ones
allocated by module, syscall and so on.

regards,

Mulyadi.



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux