Re: Question on Memory Leaks in Module

2008-01-24 Thread Mulyadi Santosa
Hi.. On 1/24/08, sahlot arvind <[EMAIL PROTECTED]> wrote: > >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 h

Re: Question on Memory Leaks in Module

2008-01-23 Thread sahlot arvind
>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, sa

Re: Question on Memory Leaks in Module

2008-01-23 Thread sahlot arvind
>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 ke

Re: Question on Memory Leaks in Module

2008-01-23 Thread Mulyadi Santosa
Hi... On Jan 24, 2008 1:32 PM, sahlot arvind <[EMAIL PROTECTED]> 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

Re: Question on Memory Leaks in Module

2008-01-23 Thread sahlot arvind
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

Re: Question on Memory Leaks in Module

2008-01-23 Thread Bernd Petrovitsch
On Mit, 2008-01-23 at 18:31 +0530, Manish Katiyar wrote: [...] > So If i do a kzalloc() in my module and then unload my module without > freeing it, it will be a memory leak...Am i right ?? .. Or the Yes. > kernel is intelligent enough to check and free those memory buffers > during unloa

Re: Question on Memory Leaks in Module

2008-01-23 Thread Thomas Petazzoni
Le Wed, 23 Jan 2008 14:30:40 +0530, "sahlot arvind" <[EMAIL PROTECTED]> a écrit : > I have written a simple LKM. I just want to test whether there is a > memory leak in the module or not? The best way is to read your code, and let others review your code. If the design is correct and simple, then

Re: Question on Memory Leaks in Module

2008-01-23 Thread Thomas Petazzoni
Le Wed, 23 Jan 2008 18:31:02 +0530, "Manish Katiyar" <[EMAIL PROTECTED]> a écrit : > So If i do a kzalloc() in my module and then unload my module without > freeing it, it will be a memory leak...Am i right ?? .. Right. This memory will be lost. > Or the kernel is intelligent enough to

Re: Question on Memory Leaks in Module

2008-01-23 Thread Manish Katiyar
Hi, So If i do a kzalloc() in my module and then unload my module without freeing it, it will be a memory leak...Am i right ?? .. Or the kernel is intelligent enough to check and free those memory buffers during unload of the module ? Thanks in advance On Jan 23, 2008 6:24 PM, Mulyadi Sa

Re: Question on Memory Leaks in Module

2008-01-23 Thread Mulyadi Santosa
Hi... On Jan 23, 2008 4:00 PM, sahlot arvind <[EMAIL PROTECTED]> wrote: > I have written a simple LKM. I just want to test whether there is a memory > leak in the module or not? > > Could any body suggest me how to test the memory leakage in LKM? Hard to say. You mean, i.e you did kmalloc() insid