This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Suggestion for memory leak detection


On Sunday 15 September 2002 07:42 am, Gary Thomas wrote:
> On Sun, 2002-09-15 at 08:40, NavEcos wrote:
> > I am interested in making a modification to the cyg_mempool_fix (and
> > _var) and their underlying C++ classes to keep track in real time how
> > much memory is allocated.
> >
> > My idea is this, if the appropriate CDL option is set on, every time:
> >
> > * a heap is created
> > * a block of memory is allocated
> > * a block of memory is freed
> > * a heap is destroyed
> >
> > A callback function will be invoked.
> >
> > This will allow tasks to keep track of memory allocation in real time,
> > for high water marks etc.  You could also use it for visual
> > representation to detect when a memory allocation fails and stop the
> > system to debug since most embedded systems don't handle malloc failures
> > too gracefully.
> >
> > What do you think of this as a feature?  I can implement it, the only
> > part I might stumble on would be the CDL.
>
> Sounds useful - go for it!
>
> One thing to think about would be to write some tests that
> both utilize and test the facilities.  This is a good way
> to verify that things work, as well as document how :-)

OK,

I should have something ready for trial and criticism by mid next week

Thanks,
-Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]