lkml.org 
[lkml]   [2002]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: detect memory leak tools?
Hi Mike,

Thanks for the suggestions. :)

- Joe

On Thu, 21 Feb 2002, Mike Galbraith wrote:

> On Thu, 21 Feb 2002, Richard B. Johnson wrote:
>
> > On Thu, 21 Feb 2002, Joe Wong wrote:
> >
> > > Hi,
> > >
> > > Is there any tools that can detect memory leak in kernel loadable
> > > module?
> > >
> > > TIA.
> > >
> > > - Joe
> >
> > How would it know? If you can answer that question, you have made
> > the tool. It would be specific to your module. FYI, in designing
> > such a tool, you often the find the leak, which means you don't
> > need the tool anymore.
> >
> > I would start by temporarily putting a wrapper around whatever you
> > use for memory allocation and deallocation. The wrapper code keeps
> > track of pointer values and outstanding allocations. If the outstanding
> > allocations grow or if the pointers to whatever_free() are different
> > than the pointers to whatever_alloc(), you have a leak. You can read
> > the results from a private ioctl().
>
> Close to how memleak works. Wrap all allocators, and maintain a 1/32
> scale model of memory consisting of tags showing who allocated that
> ram-clod when. Read allocation array via proc.
>
> For most leaks, you're right.. the tool is too much horsepower for
> the problem. Memleak has found some very non-trivial leaks though.
> It found one that was irritating Ingo quite a bit, and he designed
> memleak :)
>
> -Mike
>
>

--


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.045 / U:18.472 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site