This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: Suggestion for memory leak detection
- From: Gary Thomas <gthomas at ecoscentric dot com>
- To: NavEcos <ecos at navosha dot com>
- Cc: eCos patches <ecos-patches at sources dot redhat dot com>
- Date: 15 Sep 2002 08:42:32 -0600
- Subject: Re: Suggestion for memory leak detection
- References: <1032100814.4805.7.camel@localhost.localdomain>
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 :-)
--
------------------------------------------------------------
Gary Thomas |
eCosCentric, Ltd. |
+1 (970) 229-1963 | eCos & RedBoot experts
gthomas@ecoscentric.com |
http://www.ecoscentric.com/ |
------------------------------------------------------------